-
Notifications
You must be signed in to change notification settings - Fork 6k
[BUG] Proxy conflicts with CommandHandler. #4526
Copy link
Copy link
Closed
Labels
📋 invalidwork status: invalidwork status: invalid
Description
Steps to Reproduce
from loguru import logger
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
bot_token = "xxxx"
proxy = "http://127.0.0.1:1080"
async def get_config(update: Update, context: ContextTypes.DEFAULT_TYPE):
try:
chat_id = update.effective_chat.id
print(chat_id)
except Exception as e:
logger.exception(e)
if __name__ == '__main__':
application = ApplicationBuilder().token(bot_token).proxy(proxy=proxy).build()
application.add_handler(CommandHandler('get_config', get_config))
application.run_polling(allowed_updates=Update.ALL_TYPES)
Expected behaviour
Input /get_config on the Telegram bot, and the console will output the chat_id.
Actual behaviour
With this proxy setup, the command handler is not working; the get_config method is not being entered, and there is no output for chat_id.
Operating System
windows10
Version of Python, python-telegram-bot & dependencies
python3.10
python-telegram-bot>=21.6
Relevant log output
No response
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
📋 invalidwork status: invalidwork status: invalid