Answer the question
In order to leave comments, you need to log in
Why can't I launch the bot on Telegram.Bot?
Hello. I'm trying to write a bot using Telegram.Bot. The code is like this:
var Bot = new Telegram.Bot.TelegramBotClient("221525126:AAFNt2Hgidk_rnIovjwNqj4pzPWZetnOVNs"); // Инициализируем
await Bot.SetWebhookAsync(""); // Убираем старую привязку к WebHook
Bot.OnUpdate += async (object su, Telegram.Bot.Args.UpdateEventArgs updates) =>
{
Console.WriteLine("Text");
if (updates.Update.CallbackQuery != null || updates.Update.InlineQuery != null) return;
var update = updates.Update;
var message = update.Message;
if (message == null) return;
if (message.Type == Telegram.Bot.Types.Enums.MessageType.Text)
{
await Bot.SendTextMessageAsync(message.Chat.Id, "dd", replyToMessageId: message.MessageId);
}
};
Bot.StartReceiving();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question