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
acronieOP2y 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
acronieOP2y 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
acronieOP2y ago
file structure is fine too
acronie
acronieOP2y 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
acronieOP2y 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
acronieOP2y 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
acronie
acronieOP2y ago
oh works thanks also is their any help with reactions as I am using the old message thingy I wanna use reactions is it available in the framework>'
Favna
Favna2y ago
Wdym old message thingy and use reactions. Do you mean buttons? Anyway the framework supports everything that djs does, and djs supports buttons
acronie
acronieOP2y ago
Do you mean buttons
not buttons normal reactions isn't buttons limited to the slash commands?
Favna
Favna2y ago
No
Sean
Sean2y ago
No
acronie
acronieOP2y ago
oh icc didn't knew that
Favna
Favna2y ago
And reactions have been around for like 7 years. Literally longer than sapphire even exists. Ofc it supports them.
acronie
acronieOP2y ago
I didn't mean "support" I meant like some util functiins to make it easier and I have to write less code 😛
Spinel
Spinel2y ago
@sapphire/discord.js-utilities
Discord.js specific utilities for your JavaScript/TypeScript bots ❯ Author: sapphiredev ❯ Maintainers: favna, kyranet, and vladfrangu ❯ Latest version: 5.1.2 ❯ License: MIT ❯ Date Created: <t:1609519287:d> ❯ Date Modified: <t:1671410032:d> Dependencies: @sapphire/discord-utilities, @sapphire/duration, @sapphire/utilities, and tslib
acronie
acronieOP2y ago
Do buttons go in /buttons in file tree
Spinel
Spinel2y ago
Documentation suggestion for @Acronie: <:_:746069730170896405> Sapphire guide results: Interactions Handlers / Buttons
acronie
acronieOP2y ago
doesn't say anything ;p
Favna
Favna2y ago
It does
Spinel
Spinel2y ago
<:_:746069730170896405> Sapphire guide results: Interactions Handlers / What are they?
Favna
Favna2y ago
You could try and bother clicking around
Solution
Favna
Favna2y ago
We didn't write the guide for it to be blatantly ignored
Want results from more Discord servers?
Add your server