Skip to content

Commit

Permalink
refactor: Rename 'message' event to 'messageCreate'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayfri committed Aug 12, 2021
1 parent dcb0f48 commit ffc8d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/defaults/events/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './message';
export * from './messageCreate';
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {Message} from 'discord.js';
import {argError, codeError, CommandContext, CommandErrorType, CommandHandler, Event, EventContext, getThing, Logger, permissionsError, Tag} from '../../';
import {argError, codeError, CommandHandler, getThing, Logger, permissionsError} from '../..';
import {Event} from '../../classes';
import {Tag} from '../../classes/commands';
import {CommandContext, EventContext} from '../../classes/contexts';
import {CommandErrorType} from '../../classes/errors';

export class MessageEvent extends Event {
name = 'message' as const;
override readonly name = 'messageCreate';

public override async run(ctx: EventContext<this>, message: Message) {
if (message.author.bot || message.system) return;
Expand All @@ -15,7 +19,7 @@ export class MessageEvent extends Event {
if (!command) return;

const commandContext = new CommandContext({args, command, message, handler: ctx.handler});

try {
const error = await command.execute(commandContext);

Expand Down

0 comments on commit ffc8d6d

Please sign in to comment.