Listeners not working at all

So I've been having this issue recently, none of the listeners on the listeners folder seem to work and I can't find a reason that would cause this to happen. My folder structure is:
src/
├── index.ts
└── listeners
└── ready.ts
src/
├── index.ts
└── listeners
└── ready.ts
The listener:
import { Events, Listener } from '@sapphire/framework';

export class ReadyListener extends Listener<typeof Events.Debug> {
public override run() {
console.log('ready');
}
}
import { Events, Listener } from '@sapphire/framework';

export class ReadyListener extends Listener<typeof Events.Debug> {
public override run() {
console.log('ready');
}
}
Index file:
import { SapphireClient } from '@sapphire/framework';

const client = new SapphireClient({
intents: ['Guilds']
});

client.login('...');
import { SapphireClient } from '@sapphire/framework';

const client = new SapphireClient({
intents: ['Guilds']
});

client.login('...');
It's really the most basic bot ever so this is really weird, any help will be appreciated ^^
4 Replies
gab
gab14mo ago
I wrote:
client.on(Events.ClientReady, () => console.log('ready'));
client.on(Events.ClientReady, () => console.log('ready'));
on the index file and it worked fine so the event is firing, so maybe it's not being picked up for some reason????
Spinel
Spinel14mo ago
- Which version of @sapphire/framework are you using? - What's your file/folder structure? - Did you use the CLI to generate your bot? - What's your "main" property in package.json - 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? - In case you are using version 3.0.0 or higher 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.
gab
gab14mo ago
I figured it out, the main property on package.json was set to index.js instead of dist/index.js excuse me for the dum mistake
Favna
Favna14mo ago
no problem! That's why we have that regular problems response. You're far from the first with that same mistake.
Want results from more Discord servers?
Add your server