【发布时间】:2020-01-16 20:38:43
【问题描述】:
我用@botfather 制作了一个电报机器人,并将该机器人提升为公共组的管理员。每当我尝试从 python 代码发送消息时,它总是将消息发送给自己,我的意思是在私人聊天中而不是在公共组中。
编写代码的快照:
bot_token = 'XXXXXXXXXXXXXXXXXXX'
bot_chatID = '395014927'
bot_message = "Testing"
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&text=' + bot_message
response = requests.get(send_text)
response.json()
如何让机器人在群组中发送消息,而不是发送给它自己?
我在这里遗漏了什么还是需要修改一些设置?
EDIT(Solved) : 聊天组始终为负数。查找该号码以获取该组的聊天 ID。
【问题讨论】:
标签: python telegram telegram-bot