Just updated to 5.2.1 nothing working and no errors
My bot is apparently logged in, and good to go according to the logs. Discord shows the bot status green. But no commands at all work.
I was on Sapphire 2 and I generated a fresh Sapphire project and basically painstakingly copied everything over sicne that was the easiest upgrade path for me.
All of my secrets are in the .env file.
23 Replies
By “nothing works” is that just message commands? Or also chat input and context menu ones?
Also, it’s best to use latest, which is 5.2.1 at this moment. 4.0.0 is not only outdated, but it’s also broken.
@kyra 🩵🩷🤍🩷🩵 Thanks for your reply. I meant 5.2.1 that is my bad.
What do you mean by Chat input? And I do not see any context menu items but I will admit I am new with context menu items.
For example, typing !ping as per the default command that ships with the "Complete template" does nothng right now.
If I at least had some log errors to go off of...
Like the
with-typescript-complete
template?yes, when you do
sapphire new
and then select "Complete template" from the options.
It will generate a simple bot which will include a "Ping" command. The default prefix is "!" as well.
Starting my bot and running !ping
does nothing. No logs either. As you can see login seems successful and many commands have been scanned and registered.Did you modify the template in any way?
Yes I ported my old commands over to it as there were many changes to setup.ts and index.ts and utils.ts and basically every file.
What changes have you done in
index.ts
?I need more information considering the template works perfectly fine as-is, after all
If there was a conflict with my intents, would that cause Discord to ignore my bot?
Oh, of course
You removed one of the required intents
GatewayIntentBits.MessageContent
It's specified in the template, but not in your modified code: https://github.com/sapphiredev/examples/blob/main/examples/with-typescript-complete/src/index.ts#L24That fixed it. Why is there 0 errors in logs???
Because... we don't validate intents
I ported my intents from just strings:
old:
Old didn't need it because Sapphire v2 used Discord.js v13, which used Discord API v9. Specifying
MessageContent
is required in API v10 if you want message contents. Otherwise you'd only receive the content from messages pinging your bot@kyra 🩵🩷🤍🩷🩵 Thanks for the quick help. It would probably have taken me agest to compare the intents before I noticed the new required one.
No problem ^^
That is helpful information regarding this being a discord API v9 -> v10 thing.
Yeah, it's often overlooked when switching API versions, it's well hidden within many other changes, specially considering Discord.js (and we) recommend interaction commands over message commands, which is why the latter is opt-in. After all, having commands rely on prefixes is not enough for getting the intent's approval.
After all, having commands rely on prefixes is not enough for getting the intent's approval.Is that just because the API has more ceremony around slash commands?
It is because bots having access to all messages' content is a privacy liability that slash commands don't have.