#Trouble with handling events
1 messages · Page 1 of 1 (latest)
You need to add async to your method signature and await that asynchronous method (SendMessageAsync())
You won't need to return anything if the return type is Task and you have async in your method signature (and you have code which requires await)
message wasn't empty
at the deleting moment
why the exception invokes
message in discord can't be empty
yes, they can
how
if you do not have the message content intent, discord will not send the text content of the message to your bot
hans tag message content
Help, my bot stopped receiving message content!
Help, my bot stopped responding to text-based commands!
As of September 1st 2022, Discord started requiring message content intent for bots that want to read message content. This is a privileged intent!
If your bot has under 100 guilds, all you have to do is flip the switch in the developer dashboard.
If your bot has over 100 guilds, you'll need approval from Discord's end.
However, Discord urges you to use their new Slash Command API, so do make sure to see if that is a viable option for you.
As the popularity and number of Discord bots grow, it's important to keep our users and developers safe and healthy. This means from time to time, like any maturing platform, we need to update our ...
In short: enable the intent in the developer dashboard, then add the intent to your DiscordConfiguration
are u about that?
It's also likely the message was not cached by the bot
Discord will not send the deleted message when it sends that event
If your bot was not online when the message was originally sent, it will not have the message in the cache
Dunno what to tell you then
To avoid that exception, check if the content is empty before sending a message.