2017-07-31 98 views
0

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); 
     } 
+0

請提供您的錯誤和代碼片段,以便您可以更好地獲得幫助。 – tashakori

+0

@tashakori我添加了那部分。我在VS ..中獲得了紅色下劃線,並且在刪除了版本13並添加了版本10參考後,錯誤消失了。 –

回答

0

如在更新日誌mentiond: https://github.com/TelegramBots/telegram.bot/blob/master/CHANGELOG.md

「用戶和聊天的ID回覆到基本類型 DateTime是否現在是在本地時區 Splitedd Keyboardbuttons InlineKeyboardCallbackButton,InlineKeyboardCallbackGameButton,InlineKeyboardPayButton,InlineKeyboardSwitchCallbackQueryCurrentButton,InlineKeyboardSwitchInlineQueryButton和InlineKeyboardUrlButton「

請注意,InlineKeyboardButton不再可用,請改爲使用 InlineKeyboardCallbackButton。