Telegram.Bot.Examples icon indicating copy to clipboard operation
Telegram.Bot.Examples copied to clipboard

Add an Example for InlineKeyboardButton Class

Open Tktiman opened this issue 9 years ago • 2 comments

Please add an example for InlineKeyboardButton Class.

TODO (optional): Describe a specific scenario you would like to see addressed.

Help Topic: https://mrroundrobin.github.io/telegram.bot/html/T_Telegram_Bot_Types_InlineKeyboardButton.htm

Tktiman avatar Jun 02 '17 08:06 Tktiman

Tnx

Tktiman avatar Jun 02 '17 08:06 Tktiman

private static async void BotOnMessageReceived(object sender, MessageEventArgs messageEventArgs) { var message = messageEventArgs.Message; if (message == null || message.Type != MessageType.TextMessage) return;

if (message.Text.StartsWith("/inline")) // send inline keyboard
{
    var keyboard = new InlineKeyboardMarkup(new[]
    {
        new[] // first row
        {
            new InlineKeyboardButton("NEFT", "NEFT") // for single button in first row
           //,new InlineKeyboardButton("IFSC", "IFSC"), // for 2nd button in first row
         }
         //,
         //new[]  // for second row
         //{
         //    new InlineKeyboardButton("Cheque", "Cheque"),
         //    new InlineKeyboardButton("Cash", "Cash"),
         //}
    });
    await Bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
}

}

omegalogs4 avatar Jun 10 '17 12:06 omegalogs4