【发布时间】:2017-02-14 13:08:29
【问题描述】:
我想在telegram.bot 中创建自定义键盘
例如:
我们有一个从数据库或其他递归中获取的字符串数组
我们如何在 for 循环或函数中将数据从数组推送到 InlineKeyboardMarkup
//array of Button
string[] ButtonItem= new string[] { "one", "two", "three", "Four" };
//function or solution to create keyboard like this
var keyboard = new InlineKeyboardMarkup(new[]
{
new[]
{
new InlineKeyboardButton("one"),
new InlineKeyboardButton("two"),
},
new[]
{
new InlineKeyboardButton("three"),
new InlineKeyboardButton("Four"),
}
});
【问题讨论】:
标签: c# keyboard telegram telegram-bot