Commands won't be registered
I've currently only one slash command and one listener (for the ready event) but the listener won't be executed as well as the application command which also won't get registered. After I added some breakpoints to debug the bot I noticed that no breakpoint is hit in the listener and the application command file.
src/index.ts
src/commands/create-embed.ts
Solution:Jump to solution
oh, thanks for the hint. I've set the wrong main property. After changing it to the correct one (dist/index.js) everything works!
8 Replies
.sapphirerc.json
Log:
- 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.specifically the 2nd and 3rd points
Solution
oh, thanks for the hint. I've set the wrong main property. After changing it to the correct one (dist/index.js) everything works!
This must send the link to the message instead of the ID
@Rhys
Good suggestion thank you, I think I can make it reply to the solution message as well
Going to probably keep the question / solution ids in there as it's a way of preserving them incase it needs to be rebuilt in the future
or you can additionally add a section for message link along with the ID in the same embed