C# Telegram Bot message sending not working - console application

I’m trying to create a basic console app in C# that can send messages through a Telegram bot. I’m pretty new to working with Telegram bots so maybe I’m missing something obvious.

I’ve got my bot token from BotFather and I’m using it in my code. The weird thing is that my code compiles fine and runs without throwing any exceptions, but the message never actually gets sent. When I debug and check the result object, it shows status as “waiting for activation” which I don’t understand.

Here’s what I have so far:

static void Main(string[] args)
{
    Task<Message> response;
    response = SendMessageAsync();
    
    Console.ReadLine();
}

static async Task<Message> SendMessageAsync()
{
    var botClient = new Telegram.Bot.Api("my_bot_token_here");
    return await botClient.SendTextMessage("@mychannel", "hello world");
}

Can anyone help me figure out what I’m doing wrong? Is there something I need to do to actually execute the async task properly?

another gotcha - check if your bot token’s wrapped in quotes properly. i’ve seen weird stuff when tokens get mangled. also try using the actual chat ID instead of “@mychannel”. the @ format can be unreliable, especially with newer channels. forward a message from your channel to @userinfobot to get the chat ID.

Yeah, it’s the async handling like others said, but here’s another thing that’ll bite you. Your console app might be closing before the HTTP request finishes, even after you fix the await. I’ve hit this exact issue before. Throw a Console.ReadKey() at the end of your async method after sending the message, not just in Main. Gives you way better control over when the app shuts down. Also check your bot token for random spaces or weird characters - I wasted hours debugging once only to find I’d copied a trailing space from BotFather. One more check: if you’re posting to a channel instead of DMs, make sure your bot’s actually added to the channel and has posting permissions.

You’re not waiting for your async method to finish. When you call SendMessageAsync() without awaiting it, the task starts but your main thread jumps straight to Console.ReadLine() and can end before the HTTP request completes.

You’ve got two options: make your Main method async (C# 7.1+) and await the call, or use .Wait() or .GetAwaiter().GetResult() to block until it’s done. That “waiting for activation” status means the task wasn’t properly awaited.

Also check your channel username is right and your bot can actually post there. I’ve had API calls succeed but nothing shows up because of permission problems.