为什么电报在设置 webhook 后不发送更新? [英] Why doesn't telegram send the updates after setting the webhook?

查看:58
本文介绍了为什么电报在设置 webhook 后不发送更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 Telegram getUpdates API 获取更新,而在使用有效的 SSL 证书或自签名证书设置 webhook 后,它说:

I can get the updates with Telegram getUpdates API, while after setting webhook with a valid SSL certificate or self-signed certificate it says:

{"ok":true,"result":true,"description":"Webhook was set"}

但是它没有向我的 webhook 链接发送任何更新(我检查了 Nginx 和 node.js 访问日志文件),我尝试了很多带有和不带有证书的 setWebhook API 的 curl 命令,但仍然没有结果:

But it does not send any updates to my webhook link (I checked the Nginx and node.js access log files), I tried a lot of curl commands for setWebhook API with and without certificate, but still no result:

curl -s -X POST https://api.telegram.org/bot<TOKEN>/setWebhook -d url='https://www.example.tech/<TOKEN>/webhook' jq .

curl -F "url=https://www.example.tech/<TOKEN>/webhook" -F "certificate=@./www_example_tech.crt" https://api.telegram.org/bot<TOKEN>/setWebhook

推荐答案

可能是您的证书有问题.您可以在任何 SSL 在线检查器中检查您的证书吗?可以吗?

Maybe problem in your certificate. Could you check your certificate in any SSL online checker? Is it ok?

例如在这个 https://www.sslshopper.com/ssl-checker.html

如果直接调用 webhook url 也能看到 access.log 中的请求吗?

Also do you see the request in access.log if call webhook url directly?

这篇关于为什么电报在设置 webhook 后不发送更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆