sendMessage
it cannot send messages to group members
How to send a message to group members through group chat ( NOT send message to group chat)?
问问题
260 次
1 回答
0
也许这些可以帮助你:
你可以创建一个机器人
@BotFather
使用此机器人查找用户名的 id
@userinfobot
使用此代码
sendMessage
来分组成员:import requests def telegram_bot_sendtext(bot_message): your_bot_token = 'bot_token' your_user_name_ID = ['user_id_1', 'user_id_2', ...] response = '' for user_id in your_user_name_ID: send_text= "https://api.telegram.org/bot" + your_bot_token +"/sendMessage?chat_id=" + user_id + "&parse_mode=MarkdownV2&&text=" + bot_message response = response + str(requests.get(send_text)) return response telegram_bot_sendtext("hello how do you do")
于 2021-08-01T16:15:15.397 回答