.net 电报机器人API缺少对象
nuget telegram bot api第13版中是否删除了.net 电报机器人API缺少对象,.net,bots,telegram,.net,Bots,Telegram,nuget telegram bot api第13版中是否删除了InlineKeyboardButton? 我使用了一个使用telegram.bot版本10的示例项目,它包含telegram.bot.types中的InlineKeyboardButton,工作正常 但是当我使用版本13时,我得到了一个错误 有什么想法吗 这是整个代码的一部分: if (message.Text.StartsWith("/inline")) // send inline keyboard
InlineKeyboardButton
?
我使用了一个使用telegram.bot版本10的示例项目,它包含telegram.bot.types
中的InlineKeyboardButton
,工作正常
但是当我使用版本13时,我得到了一个错误
有什么想法吗
这是整个代码的一部分:
if (message.Text.StartsWith("/inline")) // send inline keyboard
{
await Bot.SendChatActionAsync(message.Chat.Id, ChatAction.Typing);
var keyboard = new InlineKeyboardMarkup(new[]
{
new[] // first row
{
new InlineKeyboardButton("1.1"),
new InlineKeyboardButton("1.2"),
},
new[] // second row
{
new InlineKeyboardButton("2.1"),
new InlineKeyboardButton("2.2"),
}
});
await Task.Delay(500); // simulate longer running task
await Bot.SendTextMessageAsync(message.Chat.Id, "Choose",
replyMarkup: keyboard);
}
如变更日志中所述:
“用户和聊天室ID恢复为基本类型
日期时间现在在本地时区
InlineKeyboardCallback按钮、InlineKeyboardCallbackGameButton、InlineKeyboardPay按钮、InlineKeyboardSwitchCallbackQueryCurrentButton、InlineKeyboardSwitchInlineQueryButton和InlineKeyboardUrlButton中的拆分键盘按钮“
请注意,InlineKeyboardButton不再可用,请使用
InlineKeyboardCallbackButton。请提供您的错误和代码片段,以便获得更好的帮助。@tashakori我添加了该部分。我在VS中得到了红色下划线。。在删除版本13并添加版本10引用后,错误消失了。