Skip to main content

BLAZOGRAM - is a library for make Telegram Bots

Project description

BLAZOGRAM - A library for make Telegram Bots.

Install

$ pip install blazogram

Example Usage

from blazogram import Bot, Dispatcher, BlazeLocale
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


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.1.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

blazogram-2.1-py3-none-any.whl (27.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page