commands arent working
someone help me, the bot isnt working, it does go online, I dont get any error.
ping.ts:
7 Replies
1. Which version of
@sapphire/framework
are you using?
2. What's your file/folder structure?
3. Did you use the CLI to generate your bot?
4. What's your main
(CJS) or module
(ESM) property in package.json
5. Are you using TypeScript? And if so, how are you compiling and running your code? That is to say, what are your build and startup scripts?
- Did you remove your output folder and rebuild then try again?
6. Is 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.1. 5.2.1
2. first pic
3. no
4. ESNext
5. yes, with tsx for dev (watch) and tsc for compile. my scripts: "scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node ."
},
6. I ran without building
7. its also related to that, but slash commands too. It doesnt register the slash command either. And yes I did add that
4 asks what the property is, not what variant you're using
Solution
top of the guide:
You should make sure it's identical between build and dev lest you end up changing it constantly. For example you can switch tsx with tsup and always run through
node .
(tsup --watch --on-success=\"pnpm run start\"
)or if you prefer
tsc
to compile for prod then use something like https://www.npmjs.com/package/tsc-watchnpm
tsc-watch
The TypeScript compiler with onSuccess command. Latest version: 6.2.0, last published: 6 months ago. Start using tsc-watch in your project by running
npm i tsc-watch
. There are 215 other projects in the npm registry using tsc-watch.1. thanks for the tips, I had many problems with the compiler missmatch.
2. It worked!! Can't believe I missed that 😅