Telegram.Bot.Examples
Telegram.Bot.Examples copied to clipboard
Add an Example for InlineKeyboardButton Class
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
Tnx
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);
}
}