簡體   English   中英

Pythonanywhere 服務器不通過 webhook 從 Telegram 接收任何更新

[英]Pythonanywhere server does not receiving any updates from Telegram via webhook

在我更新存儲庫之前一切正常。 這段代碼沒有任何變化。 但它現在不起作用。 get_message function 甚至沒有調用。

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

這是 getWebhookInfo 方法的結果。 url 屬性是正確的。

{"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"}}

我檢查了證書-沒問題。 我嘗試使用 ngrok URL 設置 webhook,但我失敗了。

如果問題是在存儲庫更新后出現的,那么問題很可能就是由它引起的。 嘗試恢復以查看是否可以解決問題。 如果是這樣,那么差異將有助於調試

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM