0
私は電報ボットに新たなんだ、その目的は、このコードを書くために、私のボットのカスタムキーボードを作成したい:私はこのラインでそのコードを実行するとC#でテレグラムボットにカスタネットキーボードを作成するにはどうすればいいですか?
var rkm = new ReplyKeyboardMarkup();
rkm.Keyboard =
new KeyboardButton[][]
{
new KeyboardButton[]
{
new KeyboardButton("1-1"),
new KeyboardButton("1-2")
},
new KeyboardButton[]
{
new KeyboardButton("2")
},
new KeyboardButton[]
{
new KeyboardButton("3-1"),
new KeyboardButton("3-2"),
new KeyboardButton("3-3")
}
};
WebRequest req = WebRequest.Create("https://api.telegram.org/bot" + "282189232:AAGdsdsdsdVOrsxy2rzU75QUAnWL_F2vo" + "/sendMessage?chat_id=" + chat_id + "&text=" + message + "&reply_markup=" + rkm);
req.UseDefaultCredentials = true;
var result = req.GetResponse();
req.Abort();
しかし:
var result = req.GetResponse();
このエラーが出る:
The remote server returned an error: (400) Bad Request.
どのように私はその問題を解決することができますか?
すでに電報ボットと通信するためのSDKを使用することができますが存在する、ここhttps://github.com/MrRoundRobin/telegram.botことを行うための偉大なSDKです –