简体   繁体   English

电报机器人无法向超级群组发送消息

[英]telegram bot can't send messages to super group

this is my code 这是我的代码

private async void Bot_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e)
    {

        var message = e.Message; if (message == null || message.Type != MessageType.Text) return; await Bot.SendTextMessageAsync(message.Chat.Id, "Hello?");

in this case, it works well with super groups 在这种情况下,它可以与超级组配合使用

but await Bot.SendTextMessageAsync([supergroup chat id], "Hello?"); 但是等待Bot.SendTextMessageAsync([supergroup chat id],“ Hello?”);

put Super Group ID in here[supergroup chat id], it won't work. 将超级群组ID放在这里[超级群组聊天ID],它将无法正常工作。 I've set up all the group permissions. 我已经设置了所有组权限。 After upgrading the super group, I had to drop the bot and invite again 升级超级组后,我必须放下机器人并再次邀请

Just in case if you are haven't figured it out already... When a group is upgraded to supergroup, new ID is generated: 以防万一,如果您还没有弄清楚...将组升级到超组时,将生成新的ID:

{
    "ok": false,
    "error_code": 400,
    "description": "Bad Request: group chat was upgraded to a supergroup chat",
    "parameters": {
        "migrate_to_chat_id": -1001432162429
    }
}

Use this migrate_to_chat_id to send messages 使用此migration_to_chat_id发送消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM