MessageCreate Event isn't working

This is the first listener Im creating I've read the documentation 50 times imo and checked out the examples and I am still confused

import { Events, Listener } from '@sapphire/framework';
import type {  Message } from 'discord.js';

export class UserEvent extends Listener<typeof Events.MessageCreate> {
    public override async run(msg: Message) {
        try {
            this.container.logger.info(`Message sent by ${msg.author.username} in ${msg.guild?.name} (${msg.guildId})`);
            
        } catch (error) {
            this.container.logger.fatal(error);
        }
    }
}
Solution
you either have to name it
messageCreate.<ext>
or add a constructor with
name: Events.MessageCreate
(which resolves to
name: 'messageCreate'
Was this page helpful?