#Bot no longer receiving messages after update from 4.2 to 4.4.2

1 messages · Page 1 of 1 (latest)

raw walrus
#

Hey folks, need some help.

Just updated my nuget package from 4.2 to 4.4.2, and now my bot doesn't appear to be seeing any messages.

I'm sure it's something I've missed. It's not a deployment issue, far as I can tell, because it repros even in local execution.

I tried updating the token, and I've removed and re-invited the bot via the OAUTH URL link

Also added intents in code.

Possible my intents are not sufficiently scoped?

silver sleetBOT
#
Automated suggestion: You don't have the Message Content Intent enabled

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 (over at https://discord.com/developers/applications, also see the image) and then specifying the intent in your DiscordConfiguration (see the code example)
If your bot has over 100 guilds, you'll need approval from Discord's end.

Even though you can just use this to get away with it, it is recommended by Discord to use Slash Commands whenever possible, so look into that if you can (Slash Commands Documentation)

More info:
https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Privileged-Intent-FAQ

Code Example:

DiscordConfiguration config = new() {
    // ...
    // If you do not set this, your bot will fail to start with the error code: "Disallowed intent(s)"
    Intents = DiscordIntents.AllUnprivileged | DiscordIntents.MessageContents,
    // ...
}
raw walrus
#

I believe I've added this correctly, but still not seeint messages.

humble spear
#

can you send your DiscordConfiguration?

raw walrus
#

I'm afraid I'm not sure where that is?

#

This is the code snippet

humble spear
#

this looks right

#

do you get some warning in console on startup?

raw walrus
#

Not in console, no.

#

I get a few warning at compile time about await issues, but that's nothing new.

#

Console just goes

#

I never hit my new message breakpoint

#

I removed and re-added the bot from my server just to make sure.

#

I added the bot using the OAuth URL. Seemed to work correctly.

humble spear
#

try set MinimumLogLevel to LogLevel.Debug in your config

raw walrus
#

Out of curiosity, what should the target .NET framework be?

#

Currently set to .NET 6.0

raw walrus
humble spear
#

.net 6 and above is targeted

humble spear
raw walrus
#

Got it.

humble spear
#

hmm seems right

raw walrus
#

Yeah, Token update seemed to go smoothly, as did adding the intents.

humble spear
#

You would get something like this when the intents where fck up:
[02:11:40 INF] Connection terminated (4014, 'Disallowed intent(s).')

raw walrus
#

Yeah, I saw that once while fiddling with the intents. I asked for all the intents and was refused.

humble spear
#

are you sure the bot is allowed to see the messages in the channel where you test?

raw walrus
#

I believe so, but I can check that.

#

It looks like it?

humble spear
#

if the channel has no overwrites this should work

raw walrus
#

I concur 🙂

#

Now we just need to get the bot to agree with us.

humble spear
#

the only change you made is the version jump?

raw walrus
#

Yeah.

#

Hey, I think it just starting working.

humble spear
raw walrus
#

I had to add an additional role to the bot.

#

I think what happened here was:

  1. Upgraded just framework
  2. Started failing
  3. Removed and re-added bot (didn't update role)
  4. Still failing
  5. Updated intents
  6. Still failing, because bot role wasn't updated
#

So now that I've updated the bot role and got my intents straight, it looks like a message got through.

#

Sweet. Thank you for your work on this awesome project and for your help here.