侧边栏壁纸
博主头像
SANDIVIK 博主等级

行动起来,活在当下

  • 累计撰写 64 篇文章
  • 累计创建 6 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

telegram bot 命令

Administrator
2024-05-19 / 0 评论 / 0 点赞 / 19 阅读 / 0 字

//Set Webhook

https://api.telegram.org/bot123456:ABCDEF-1234/setWebhook?url=https://你的DomainName/你的程式路徑

{

"ok": true,

"result": true,

"description": "Webhook was set"

}

https://api.telegram.org/bot6965227238:AAEvQVb0K4q7CQuLacf6WBEF_J36cW-ZbC0/setWebhook?url=https://www.shinx.xyz/5783264512

//Delete(Remove) Webhook

https://api.telegram.org/bot123456:ABCDEF-1234/deleteWebhook

{

"ok": true,

"result": true,

"description": "Webhook was deleted"

}

https://api.telegram.org/bot6965227238:AAEvQVb0K4q7CQuLacf6WBEF_J36cW-ZbC0/deleteWebhook

//Get Webhook Information

https://api.telegram.org/bot6965227238:AAEvQVb0K4q7CQuLacf6WBEF_J36cW-ZbC0/getWebhookInfo

{

"ok": true,

"result": {

"url": "",

"has_custom_certificate": false,

"pending_update_count": 0

}

}

获取 chatId

观察这个 url https://api.telegram.org/bot{token}/getUpdates

使用第二步获得的 token 替换上述 url 中的 {token} 然后得到新的 url,复制粘贴到浏览器地址栏,回车请求。不出意外你会得到如下 response

{

"ok": true,

"result": []

}

0

评论区