Cant get bot to work when put bot related files to another folder in src
Hello i try to put my botfiles to src/bot/ but the bot wont work if i do this:
![No description](https://cdn.answeroverflow.com/1225879057950838955/image.png)
Solution:Jump to solution
either drop the "bot" subfolder and set
main
to dist/index.js
in package.json
OR override the automatically resolved folder by setting baseUserDirectory
in the client options19 Replies
tsconfig.json
![No description](https://cdn.answeroverflow.com/1225879507408392252/image.png)
Sapphire will look for folders called
commands
and listeners
in the same directory that the main
property is configured to be at in the package.json
as per the top red block on our guide: https://sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire
You will have likely set it to dist/index.js
so you will either need dist/commands
and such, or set a custom directory with baseUserDirectory
in the client options. (make sure you dont set it to a directory in src
if you do!)Sapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and
so i cant run the bot in src/bot ?
Node cannot run TS files directly so you will need to compile them first and as per your own config the files will be output to dist
yeah i can compile it but it doesnt recognized src/bot/listeners/
![No description](https://cdn.answeroverflow.com/1225882730617766029/image.png)
because of what I said...
Solution
either drop the "bot" subfolder and set
main
to dist/index.js
in package.json
OR override the automatically resolved folder by setting baseUserDirectory
in the client optionsbaseUserDirectory must be bot then?
dist/bot
is there more to the error
yes wait
other files also
![No description](https://cdn.answeroverflow.com/1225884567412539492/image.png)
I honestly have no idea. Pinging @kyra 🩵🩷🤍🩷🩵 in here