listener not loading.
I have no idea what the issue is, but the listener just never loads.
according to the doc's it's supposed to auto load the listener?
Solution:Jump to solution
i've got it, i used virtual pieces rather than the default file system. i assume it has something to do with the nx setup, etc.
8 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.4 and 5
also you need to enable the privileged intent: https://discordjs.guide/popular-topics/intents.html#privileged-intents
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
which includes checking it here on https://discord.dev, and it's also important to note that just like Message Content intent you will need to apply to get access and have a good reason for needing that access ocne your bot is close to 100 servers
intents are enabled. Im using TS and im using nx to run it so,
pnpm nx serve discord
and no messages. presence update listener
this is my package.json
and my project.json
from nx which has the build and such in it.
looks like your problem is related to not setting a main property, see the big red block at the very start of the guide: https://sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire
How this is going to have to be implemented for you when using nx is for you to figure out though. I have no experience with nx but I would expect that every subpackage has its own package.json as is the case of any monorepo setup and so you would put it in the appropiate subpackage package.json and pray that nx sets
process.cwd()
correctly I guessSapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and
Solution
i've got it, i used virtual pieces rather than the default file system. i assume it has something to do with the nx setup, etc.
also put a
_load.ts
in the listeners folder