not working
Hi, my bot is not working does anyone know why?
index.ts:
commands/ping.ts:
12 Replies
Hello?
what's with the immediately invoked function expression tbh. why not just
anyway
- 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.btw for future reference, we have the Helpers role you can ping after ~15 minutes of no response. At the end of the day we're all busy people too. Like basically any coding support anywhere we're not constantly monitoring for new posts.
Okay
1. I did it as its described in the guide
2.
bot/
source/
index.ts
commands/
ping.ts
3. I dont have a main property
4. yes, yarn tsc && node dist/index.ts
5. 3
6. Yes
Solution
3. I dont have a main propertyyou say you following the guide but...
anyway you should also use Sapphire v4.
Sapphire v3 is ... i mean.. still supported ofc but not latest
Oh 😂
Okay i will use it
Thank you so much
np
you can use the CLI if you want to generate a template that's pretty much ready to go
@sapphire/cli
CLI for Sapphire Framework
❯ Author: sapphiredev
❯ Maintainers: favna, vladfrangu, and kyranet
❯ Latest version: 1.3.1
❯ License: MIT
❯ Date Created: <t:1632429711:d>
❯ Date Modified: <t:1674969820:d>
Dependencies:
@favware/colorette-spinner, @sapphire/result, colorette, commander, execa, find-up, js-yaml, prompts, and tslib
can i change the name of my listeners folder or does it not work then?
not by default no, but you can manually register it yourself if you really want to
not sure why you'd want to rename it though, they are event listeners after all