|
@@ -332,6 +332,25 @@ For support or issues, check the logs or contact the administrator.
|
|
|
|
|
|
async def run(self):
|
|
|
"""Run the bot."""
|
|
|
+ if not Config.TELEGRAM_BOT_TOKEN:
|
|
|
+ logger.error("❌ TELEGRAM_BOT_TOKEN not configured")
|
|
|
+ return
|
|
|
+
|
|
|
+ if not Config.TELEGRAM_CHAT_ID:
|
|
|
+ logger.error("❌ TELEGRAM_CHAT_ID not configured")
|
|
|
+ return
|
|
|
+
|
|
|
+ logger.info(f"🔧 Using python-telegram-bot version: {telegram.__version__} (Running in v20.x style)")
|
|
|
+
|
|
|
+ # Create application
|
|
|
+ self.application = Application.builder().token(Config.TELEGRAM_BOT_TOKEN).build()
|
|
|
+
|
|
|
+ # Connect notification manager to the bot application
|
|
|
+ self.notification_manager.set_bot_application(self.application)
|
|
|
+
|
|
|
+ # Set up handlers
|
|
|
+ self.setup_handlers()
|
|
|
+
|
|
|
logger.info("🚀 Initializing bot application (v20.x style)...")
|
|
|
await self.application.initialize()
|
|
|
|