【问题标题】:timeout in telegram.bot webhook - asp.net mvctelegram.bot webhook 中的超时 - asp.net mvc
【发布时间】:2020-03-28 18:32:28
【问题描述】:

我使用 Telegram.Bot 开发了一个电报机器人。

我尝试使用 bot 返工,首先我使用 BotFather 创建了 bot 并获得了令牌。

我在电报 api 中设置了 webhook 服务器 api 地址。但是当我检查 webhookinfo 它返回这个错误

https://api.telegram.org/botToken/getWebhookinfo

回复:

"last_error_date":1585419712,"last_error_message":"连接超时"

我检查了它需要 TLS12 才能使用安全连接

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

但它没有在我的服务器中获取更新并显示超时错误。

我尝试使用 postman 和 ngrok 在我的 iisexpress 上运行发帖,我正在获取数据并可以在我的本地主机中向机器人发送消息。

但是在托管时它不起作用,新的 Telegram.Bot 库或电报服务器有什么问题?


更新

我与邮递员核对了我的托管网址,邮递员也无法连接到该网址。我的代码有什么问题?

这是我在主机中调用更新接收 URL 时的响应:

连接尝试失败,因为连接方一段时间后没有正确响应,或者连接建立失败,因为连接的主机没有响应10.10.34.35:443

【问题讨论】:

    标签: asp.net-mvc telegram-bot telegram-webhook


    【解决方案1】:

    我遇到了问题,我们使用的证书应该是有效的,而不是免费的。

    欲了解更多信息,请研究此链接: https://core.telegram.org/bots/webhooks

    【讨论】:

      猜你喜欢
      • 2016-06-26
      • 2015-12-19
      • 2020-11-09
      • 2011-08-12
      • 1970-01-01
      • 1970-01-01
      • 2017-07-30
      • 2016-03-27
      • 2016-09-11
      相关资源
      最近更新 更多