错误 CS0234 命名空间 'Telegram.Bot' 中不存在类型或命名空间名称 'SendTextMessageAsync'
Error CS0234 The type or namespace name 'SendTextMessageAsync' does not exist in the namespace 'Telegram.Bot'
我想在 c# 中的电报机器人中创建 InlineKeyBord
但我有这个错误:
CS0234 The type or namespace name 'SendTextMessageAsync' does not exist in the namespace 'Telegram.Bot'
var keyboard = new ReplyKeyboardMarkup(new [] {
new [] // 1st row
{
new KeyboardButton("1"),
new KeyboardButton("2"),
},
new [] // 2nd row
{
new KeyboardButton("3"),
new KeyboardButton("4"),
}
});
await Telegram.Bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
变化:
await Telegram.Bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
至:
// see https://mrroundrobin.github.io/telegram.bot/html/M_Telegram_Bot_TelegramBotClient__ctor.htm
var bot = new Telegram.Bot.TelegramBotClient(yourtokenhere);
await bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
我想在 c# 中的电报机器人中创建 InlineKeyBord 但我有这个错误:
CS0234 The type or namespace name 'SendTextMessageAsync' does not exist in the namespace 'Telegram.Bot'
var keyboard = new ReplyKeyboardMarkup(new [] {
new [] // 1st row
{
new KeyboardButton("1"),
new KeyboardButton("2"),
},
new [] // 2nd row
{
new KeyboardButton("3"),
new KeyboardButton("4"),
}
});
await Telegram.Bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
变化:
await Telegram.Bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);
至:
// see https://mrroundrobin.github.io/telegram.bot/html/M_Telegram_Bot_TelegramBotClient__ctor.htm
var bot = new Telegram.Bot.TelegramBotClient(yourtokenhere);
await bot.SendTextMessageAsync(message.Chat.Id, "Choose", replyMarkup: keyboard);