【发布时间】:2019-08-22 02:48:15
【问题描述】:
所以我使用@BotFather 制作了一个机器人,并从我的帐户中向它发送了消息。然后我使用@userinfobot 找到了我的帐户 ID 并发送了这个请求:
https://api.telegram.org/botTOKEN/sendMessage?chat_id=id&text=test
它工作正常ok:true。
但是,如果我尝试使用 @username 而不是 id:
https://api.telegram.org/botTOKENg/sendMessage?chat_id=@username&text=test
我收到一个错误:
{
"ok": false,
"error_code": 400,
"description": "Bad Request: chat not found"
}
查看我过去的代码,@ 方法以前对我有用。情况有变化吗?
【问题讨论】:
标签: telegram telegram-bot python-telegram-bot