Bots 如何在C#中创建动态键盘按钮电报机器人?

Bots 如何在C#中创建动态键盘按钮电报机器人?,bots,telegram,Bots,Telegram,如何在C#中创建动态键盘按钮bot电报 例如,从数据库中读取值并将值设置为button ALL count of button equal database行。您可以读取数据库单元格并将其作为文本插入[\”“+SqlDataReaderTest[“YouDataCell”]。ToString()+“\”] 请记住(消息+键盘)长度不得超过4000个字符 string keyboard= "&reply_markup={\"keyboard\":["; string temp="";

如何在C#中创建动态键盘按钮bot电报


例如,从数据库中读取值并将值设置为button ALL count of button equal database行。

您可以读取数据库单元格并将其作为文本插入[\”“+SqlDataReaderTest[“YouDataCell”]。ToString()+“\”]

请记住(消息+键盘)长度不得超过4000个字符

 string keyboard= "&reply_markup={\"keyboard\":[";
 string temp="";
 while (SqlDataReaderTest.Read())
                {
         temp+=(temp.length==0?"[\"":"],[\"")+SqlDataReaderTest["YouDataCell"].ToString()+"\"]";
                }
keyboard+=temp+"}";