Why my listener doesn't work?
Hello, i am trying to make a uptime checker thing. I'm currently just using a ready listener for test.
main.ts
ready.ts
I'm sure that my client is logging up and ready (line 30 in main.ts gets executed)
Solution:Jump to solution
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?...4 Replies
I duplicated your code and it failed for me as well. I was unable to resolve it.
Have you made the project with the Sapphire CLI? Or an existing project
oh
idk never seen Sapphire CLI in documentation so i just manually installed sapphire
pnpm add @sapphire/framework [email protected]
Solution
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.When using pnpm you have to make sure that you have the
shamefully-hoist
and public-hoist-pattern
are set correctly in your .npmrc
file.
This is because pnpm will not hoist any dependencies by default and that poses a problem with how Sapphire works with module augmentation and loading files from the filesystem.
Add this to your .npmrc
file: