简体   繁体   中英

Pythonanywhere server does not receiving any updates from Telegram via webhook

All was working until I updated repository. Nothing was change in this piece of code. But it happed not working now. The get_message function not even calls.

URL = 'name.pythonanywhere.com'
app = Flask(__name__)

bot.remove_webhook()
bot.set_webhook(url=URL)

bot.send_message(userID, 'helo')
context = context.Context(default.Default())

@app.route('/', methods=['POST', 'GET'])
def get_message():
    update = types.Update.de_json(request.stream.read().decode('utf-8'))
    bot.process_new_updates([update])
    return 'ok', 199

Here is a result from getWebhookInfo method. The url property is correct.

{"ok":true,"result":
{"url":"name.pythonanywhere.com",
"has_custom_certificate":false,
"pending_update_count":11,
"last_error_date":1673875844,
"last_error_message":"Connection timed out",
"max_connections":40,
"ip_address":"35.173.69.207"}}

I checked certificate- it's ok. I tried to set webhook with ngrok URL, but i was failed.

If the issue arose after the repository update, it seems likely that that caused the problem. Try reverting to see whether that fixes it. If it does, then the diff will be useful for debugging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM