Commands not working

I created a command and it won't work.
Solution:
We didn't write the guide for it to be blatantly ignored
Jump to solution
31 Replies
acronie
acronie2y ago
I created a command the bot would initialise and start but I don't think so the commands are being loaded it doesn't work with a default prefix i am initialising it with @bot command works
Spinel
Spinel2y ago
Tag suggestion for @Acronie: When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stacktraces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. ❯ For an excellent video that shows how not to ask technical questions is this, watch this YouTube video by LiveOverflow. ❯ Asking technical questions (Clarkson)How to ask questions the smart way (Raymond)
24
242y ago
Uhg What's the stupid tag for sapphire support questions
Spinel
Spinel2y ago
- Did you use a folder of the examples repository or did you use the CLI to generate your bot? - What's your file/folder structure? - What's your "main" property in package.json - Are you using TypeScript? And if so, how are you compiling and running your code? - Are you using the version 2 or version 3 of @sapphire/framework? - In case you are using version 3 of @sapphire/framework, and your problem related to message commands, did you add loadMessageCommandListeners to your SapphireClient options Remember that if you are new to @sapphire/framework it is important that you read the user guide.
24
242y ago
Yes that thanks
Sean
Sean2y ago
regular-problems ftw
24
242y ago
Dumb name
acronie
acronie2y ago
import { SapphireClient } from '@sapphire/framework'
import { config } from 'dotenv'
config()

const client = new SapphireClient({
intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_VOICE_STATES'],
defaultPrefix: '.',
loadMessageCommandListeners: true,
})
client.login(process.env.BOT_TOKEN)
import { SapphireClient } from '@sapphire/framework'
import { config } from 'dotenv'
config()

const client = new SapphireClient({
intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_VOICE_STATES'],
defaultPrefix: '.',
loadMessageCommandListeners: true,
})
client.login(process.env.BOT_TOKEN)
loaded the messgeCommandListeners
acronie
acronie2y ago
file structure is fine too
acronie
acronie2y ago
"main": "dist/index.js", main too and using tsc-watch which is fien too
Sean
Sean2y ago
Do you have the message content intent in the dev panel? (Its a priviledged intent)
acronie
acronie2y ago
yes it works @bot command but not with the default prefix
Sean
Sean2y ago
Discord gives the bot the message content regardless if you ping it, so it not working suggests that it doesnt have the message content intent
acronie
acronie2y ago
No i am saying the command works when I ping it and use the command so it has the message content it doesn't work when I use the prefix .command
Sean
Sean2y ago
If you ping the bot or it has the priviledged intent it gets message content, otherwise it does not You need to flick the switch on the developer panel
Want results from more Discord servers?
Add your server