Answer the question
In order to leave comments, you need to log in
How to add Inline buttons to Telegram?
There is a database in which certain data is stored, which I pull out using Entity, and according to their list, you need to create Inline buttons in a chat with a bot.
var inlineSelect = new InlineKeyboardMarkup(new[]
{
new[] {InlineKeyboardButton.WithCallbackData("name1","cd1") },
new[] {InlineKeyboardButton.WithCallbackData("name2","cd2") },
new[] {InlineKeyboardButton.WithCallbackData("name3","cd3") }
});
Answer the question
In order to leave comments, you need to log in
I'll answer the question myself
List<InlineKeyboardButton> list = new List<InlineKeyboardButton>();
foreach (string s in SomeList)
{
list.Add(InlineKeyboardButton.WithCallbackData(s));
}
var inline = new InlineKeyboardMarkup(list);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question