getWebhookInfo
返回 Webhook 信息。
返回值: 调用成功时返回 WebhookInfo。
参数
此方法没有参数,直接用 Bot Token 调用即可。
请求示例
curl
curl -s "https://api.telegram.org/bot$TOKEN/getWebhookInfo"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getWebhookInfo", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getWebhookInfo`);
console.log(await res.json());
分步教程: Telegram Bot Webhook 设置教程:用 setWebhook 配置 Webhook URL 和 secret_token
相关方法
setWebhook设置 Webhook。deleteWebhook删除 Webhook。getUpdates获取更新。点击“开始”按钮可进行 Long Polling。