Skip to content

QuickestPossible🍕

MohammadReza edited this page May 12, 2022 · 5 revisions

Explanation

This is almost the quickest way you can setup an handler and listen for updates.

Code

from telegrambots.custom import TelegramBot, MessageContext, filters as flts


bot = TelegramBot("BOT_TOKEN")
dp = bot.dispatcher


@dp.add.handlers.via_decorator.message(
    flts.messages.Regex("^/start") & flts.messages.private
)
async def starting(context: MessageContext):
    await context.reply_text("Started")


if __name__ == "__main__":
    dp.unlimited("message")

Here we have funny usage examples of Custom-TelegramBots. with the taste of some fast foods 🍿.

Clone this wiki locally