all repos — gif-escarbot @ 527ce6fa9a2f40fdbbe3942582a8ef47f9bb7781

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])