import asyncio import logging from telegram import Update from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes logging.basicConfig(level=logging.INFO) BOT_TOKEN = "7864875699:AAEWf6ff1DYNzPvW6Dbn7D2W5aavg9KPhgY" async def start(update: Update, context: ContextTypes.DEFAULT_TYPE): await update.message.reply_text("โœ… Simple test works!") async def main(): print("๐Ÿงช Testing Telegram connection...") try: app = ApplicationBuilder()\ .token(BOT_TOKEN)\ .read_timeout(30)\ .write_timeout(30)\ .connect_timeout(30)\ .pool_timeout(30)\ .build() app.add_handler(CommandHandler("start", start)) print("๐Ÿค– Starting bot...") await app.initialize() await app.start() print("โœ… Bot started! Type /start in Telegram to test.") print("โณ Running for 15 seconds...") # Run for 15 seconds await asyncio.sleep(15) await app.stop() await app.shutdown() print("โœ… Test complete - no network errors!") except Exception as e: print(f"โŒ Error: {e}") print("\n๐Ÿ’ก Try: pip install python-telegram-bot==13.15") if __name__ == "__main__": asyncio.run(main())