我想创建自定义键盘 telegram.bot
例如:
我们有一个从数据库获取的字符串数组或其他的recurses如何将数据从数组推送到InlineKeyboardMarkupfor循环或函数
//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"),
}
});
Run Code Online (Sandbox Code Playgroud) 我写了一个非常复杂的代码,但是我的问题是我怎么能在我的代码中大多数时候两次解析某些字符串两次的对象,这不是问题,但是有些时候可以字符串两次。所以我无法跟踪代码来查找我的JSON对象这样的问题:
""[{\"name\":\"trane\",\"price\":\"150000\",\"order\":\"\",\"sale\":\"\",\"printedPic\":\"\",\"remainingPic\":\"\",\"locationEncome\":\"\"}]""
Run Code Online (Sandbox Code Playgroud)