添加message_thread_id后无法向Telegram话题线程发消息的问题求助
Telegram Bot 消息无法发送到指定话题问题
背景
Telegram Bot API 6.3版本新增了群组话题(Topics)支持,python-telegram-bot 13.15版本已集成该功能。
原有正常代码
我原本使用以下代码发送消息,能正常工作:
{"@type": "sendMessage", "chat_id": "-1001580394181", "input_message_content": { "@type": "inputMessageText","text": { "@type": "formattedText","text": "test", "entities": [] } } }
修改后的代码
官方新增message_thread_id参数用于指定消息发送到的话题,于是我添加了该参数,代码修改为:
{"@type": "sendMessage", "chat_id": "-1001580394181", "message_thread_id": "20451426304", "input_message_content": { "@type": "inputMessageText","text": { "@type": "formattedText","text": "test", "entities": [] } }
问题现象
修改后消息仍发送至主话题,且无任何报错;仅当传入错误的message_thread_id时,才会返回错误信息:Code: 400, message: Invalid message thread ID specified。
我确认ID是正确的,是从向话题频道发送测试消息的响应中获取的,请问我哪里操作出错了?
内容的提问来源于stack exchange,提问作者Navi
相关产品推荐
相关产品推荐

