main.py (view raw)
1from telegram.ext import MessageHandler, ApplicationBuilder, filters
2from telegram import Update
3from Config import TOKEN
4from Replacer import replace
5from Forwarder import forward, admin_forward
6
7if __name__ == "__main__":
8 application = ApplicationBuilder().token(TOKEN).build()
9 application.add_handler(MessageHandler(filters.ChatType.CHANNEL, forward))
10 application.add_handler(MessageHandler(filters.ChatType.PRIVATE, admin_forward))
11 application.add_handler(MessageHandler(filters.CHAT & ~filters.COMMAND, replace))
12 application.run_polling(allowed_updates=Update.MESSAGE)