是InlineKeyboardButton
在版本13中刪除了nuget telegram bot api? 我使用了一個使用telegram.bot版本10的示例項目,它包含telegram.bot.types
中的InlineKeyboardButton
,它工作正常。Telegram Bot API缺失對象
但是當我使用版本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);
}
請提供您的錯誤和代碼片段,以便您可以更好地獲得幫助。 – tashakori
@tashakori我添加了那部分。我在VS ..中獲得了紅色下劃線,並且在刪除了版本13並添加了版本10參考後,錯誤消失了。 –