BLAZOGRAM - is a library for make Telegram Bots
Project description
BLAZOGRAM - is a library for make Telegram Bots.
Install
$ pip install blazogram
Example of use:
from blazogram import Bot, Dispatcher
from blazogram.types import Message, CallbackQuery, ReplyKeyboardMarkup, KeyboardButton
from blazogram.filters import Command, Data
from blazogram.enums import ParseMode
import asyncio
async def start_command(message: Message):
kb = ReplyKeyboardMarkup()
button = KeyboardButton(text='BUTTON')
kb.add_button(button)
await message.answer(text='Hello World!', reply_markup=kb)
async def some_func(callback: CallbackQuery):
await callback.answer(text='Hello World!', show_alert=True)
async def main():
bot = Bot(token='YOUR-BOT-TOKEN', parse_mode=ParseMode.HTML)
dp = Dispatcher()
dp.message.register(start_command, Command("start"))
dp.callback_query.register(some_func, Data("BUTTON_DATA"))
await bot.skip_updates()
try:
await dp.start_polling(bot)
finally:
await bot.session.close()
if __name__ == '__main__':
asyncio.run(main())
Developer - @Blaze Egor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blazogram-2.0.0.tar.gz
(14.4 kB
view hashes)
Built Distribution
blazogram-2.0.0-py3-none-any.whl
(24.3 kB
view hashes)
Close
Hashes for blazogram-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8de5b0ec7a035e99675628b4ba5b189cfbe8912643457416e7f3dd022c51e2a2 |
|
MD5 | 473fbbdefcf973a8e4d58fbe0f1056d8 |
|
BLAKE2b-256 | ac57bad90ca9154d07df3ab673281574eb5579b74bdc552db2367c92fd7404ca |