简体   繁体   English

使用Telegram bot API接收来自群组或渠道的消息

[英]Receive messages from groups or channels using Telegram bot API

I'm working on an application that integrates with Telegram and I had the problem to find a way how to receive messages from groups using Telegram Bot API 我正在开发与Telegram集成的应用程序,但我遇到了一个问题,即如何找到一种方法来使用Telegram Bot API从群组接收消息

My code so far for sending a message to a group or channel my bot already admin on it. 到目前为止,我的代码用于向群组发送消息或引导我的机器人已经对其进行管理。 any suggestions? 有什么建议么?

static async Task<Telegram.Bot.Types.Message> DoSomethingAsync()
{
    var Bot = new Telegram.Bot.Api("api_token");

    return await Bot.SendTextMessage("chatid","Hello");
}

By default, your bot can only see messages in /command@YourBotName format, or reply to its message. 默认情况下,您的漫游器只能看到/command@YourBotName格式的消息,或回复其消息。

To receive all messages, please goto @BotFather , and turn off privacy mode , then re-invite your bot to group. 要接收所有消息,请转到@BotFather ,然后关闭隐私模式 ,然后重新邀请您的机器人进行分组。

/setprivacy — Set which messages your bot will receive when added to a group. /setprivacy设置您的机器人在添加到组时将收到的消息。 With privacy mode disabled, the bot will receive all messages. 在禁用隐私模式的情况下,漫游器将接收所有消息。

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

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