我有一个使用c#创建的机器人,并且它具有嵌入式键盘,例如,我想在单击hello嵌入式按钮时回复用户,而bot回复您好,先生!或另一个示例是我想在单击时发送文本消息或呼叫功能
这是我的代码:
case "/iniline":
await Bot.SendChatActionAsync(message.Chat.Id, ChatAction.Typing);
await Task.Delay(500); // simulate longer running task
var inlineKeyboard = new InlineKeyboardMarkup(new[]
{
new [] // first row
{
InlineKeyboardButton.WithCallbackData("IP"),
},
new [] // second row
{
InlineKeyboardButton.WithCallbackData("EX"),
InlineKeyboardButton.WithCallbackData("ED"),
}
});
await Bot.SendTextMessageAsync(
message.Chat.Id,
"Choose",
replyMarkup: inlineKeyboard);
break;