Skip to main content
Glama
run_telegram_bot.pyβ€’1.63 kB
#!/usr/bin/env python3 """ Script per avviare il bot Telegram IRIS """ import logging import sys from pathlib import Path # Add project root to path project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) from src.telegram_bot.bot import create_bot_application from src.config.settings import settings # Setup logging logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO ) logger = logging.getLogger(__name__) def main(): """Main function to run the bot""" try: logger.info("πŸš€ Starting IRIS Telegram Bot...") # Check configuration if not settings.TELEGRAM_BOT_TOKEN: logger.error("❌ TELEGRAM_BOT_TOKEN not configured!") logger.info("Please set TELEGRAM_BOT_TOKEN in your .env file") return # Create bot application application = create_bot_application() logger.info("βœ… Bot application created") # Start the bot (this handles the async setup internally) logger.info("πŸ€– IRIS Bot is starting...") logger.info(f"Bot token configured: {settings.TELEGRAM_BOT_TOKEN[:10]}...") # Use the synchronous run_polling method application.run_polling( allowed_updates=["message", "callback_query"], drop_pending_updates=True ) except KeyboardInterrupt: logger.info("πŸ›‘ Bot stopped by user") except Exception as e: logger.error(f"❌ Error starting bot: {e}") raise if __name__ == "__main__": main()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilvolodel/iris-legacy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server