【发布时间】:2020-12-13 04:03:05
【问题描述】:
知道怎么回复用户的消息,但是不知道怎么回复机器人最新的消息。
我需要机器人 MessageID
来自用户的这条消息: 你好 这是给用户的发送消息:
await BotAdminChannel.SendTextMessageAsync(e.Message.Chat.Id, "hello user");
这是来自用户的回复消息:
await BotAdminChannel.SendTextMessageAsync(358434970, "How are you user", replyToMessageId:e.Message.MessageId);
但我想回复你好用户 我需要 bot_messageID 吗? 怎么弄到的
class Program
{
private static ITelegramBotClient BotAdminChannel = new TelegramBotClient("token");
static void Main(string[] args)
{
BotAdminChannel.OnMessage += BotAdminChannel_OnMessage;
Console.Title = BotAdminChannel.GetMeAsync().Result.FirstName;
BotAdminChannel.StartReceiving();
Console.ReadLine();
}
private async static void BotAdminChannel_OnMessage(object sender, MessageEventArgs e)
{
await BotAdminChannel.SendTextMessageAsync(e.Message.Chat.Id, "hello user");
await BotAdminChannel.SendTextMessageAsync(358434970, "How are you user", replyToMessageId:e.Message.MessageId);
}
}
【问题讨论】:
标签: c# telegram-bot