Home > Enterprise >  Sending a message to a specified discord channel ID with DsharpPlus?
Sending a message to a specified discord channel ID with DsharpPlus?

Time:10-07

I was wondering who can help me with trying to send a message to a specified channel ID in Dsharpplus C# .net. This is my current assumption but it does not work:

await discord.SendMessageAsync(discord.GetChannelAsync(ChannelIDHERE), "Hello");

Here is the error:
Error Image

Anyone who can help would appreciated. Thanks!

CodePudding user response:

Your error is not related to DSharpPlus, it's simply an async call not being awaited, this should fix your issue:

await discord.SendMessageAsync(await discord.GetChannelAsync(ChannelIDHERE), "Hello");
  • Related