all repos — gif-escarbot @ 8074dc1990e8167cd5af16305e4c61b28f1ed24a

Earthbound Café's custom delivery bot with other cool utilities built-in.

escarbot/__main__.py (view raw)

 1from telegram import Update
 2from telegram.ext import MessageHandler, ApplicationBuilder, CallbackQueryHandler, filters
 3from escarbot.config import TOKEN
 4from escarbot.inline import inline_handler
 5from escarbot.forward import forward, admin_forward
 6from escarbot.replace import replace
 7
 8application = ApplicationBuilder().token(TOKEN).build()
 9application.add_handler(CallbackQueryHandler(callback=inline_handler))
10application.add_handler(MessageHandler(filters.ChatType.CHANNEL, forward))
11application.add_handler(MessageHandler(filters.ChatType.PRIVATE, admin_forward))
12application.add_handler(MessageHandler(filters.ChatType.GROUPS, replace))
13application.run_polling(allowed_updates=[Update.CHANNEL_POST, Update.MESSAGE, Update.CALLBACK_QUERY])