TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 686 forks source link

I'm not receiving messages #924

Closed tarikmehinagic closed 3 years ago

tarikmehinagic commented 4 years ago

I found a bug to report

Bug reports that do not follow this template will be kept closed because not-reproducible until the creator edits the post properly.

TelegramBotClient botClient = new TelegramBotClient(myToken);
Telegram.Bot.Types.ChatId chatid = mychatid;

botClient.SendTextMessageAsync(chatid, "This is message.");

Yes, I entered right token and right chatid, in fact I checked it manually by sending request on api.telegram.org.

I simply don't receive any messages.

NuGet Package Version: v15.7.1

.NET Version: .NET Framwork 4.5

IDE: VS2019

App: Desktop

karb0f0s commented 4 years ago

Hi, @tarikbrt2. According to your issue:

  1. Please try one of our examples, and see if you still unable to hear from your bot.
  2. Our library is asynchronous, so you have to await requests to Bot API:
    
    TelegramBotClient botClient = new TelegramBotClient(myToken);
    Telegram.Bot.Types.ChatId chatid = mychatid;

await botClient.SendTextMessageAsync(chatid, "This is message.");


3. Though Telegram.Bot targets .NET Framework I'd suggest you to move to modern development platforms. Please take a look at this issue #868 as you can hit this bug with older version of .NET Framework.
karb0f0s commented 3 years ago

I’m closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version and then please use the issue template.