how can I add inline buttons, cause this code examle doesn't work?
var keyboard = new InlineKeyboardMarkup
(
new InlineKeyboardButton[][]
{
// First row
new InlineKeyboardButton[] {
// First column
InlineKeyboardButton("one","callback1"),
// Second column
InlineKeyboardButton("two","callback2"),
},
}
);
All you need to do is defining the Inline Keyboard first and then use it when you send any kind of message to the user. To define an inline keyboard you should use the code below right inside your Program class:
Then inside your main function, you have to use a code like below:
Finally in order to see your inline keyboard you should use it when you send a message. For example if your message is a Text Message you could use this code:
I have used this code with Telegram.Bot API Version 13.0.0-beta-01 and it works very well. But if you want to use the recent version of this API the code for Inline Keyboards is a bit different but very similar to this.