Skip to content

Commit

Permalink
feat(events): added UnknownCommandPayload.commandName (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet authored Feb 7, 2021
1 parent dcfc6d2 commit 3dbcffd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/events/command-handler/CorePrefixedMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CoreEvent extends Event<Events.PrefixedMessage> {
// Retrieve the command and validate:
const command = stores.get('commands').get(client.options.caseInsensitiveCommands ? commandName.toLowerCase() : commandName);
if (!command) {
client.emit(Events.UnknownCommand, { message, prefix, commandPrefix });
client.emit(Events.UnknownCommand, { message, prefix, commandName, commandPrefix });
return;
}

Expand Down
4 changes: 3 additions & 1 deletion src/lib/types/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export interface UnknownCommandNamePayload {
commandPrefix: string;
}

export interface UnknownCommandPayload extends UnknownCommandNamePayload {}
export interface UnknownCommandPayload extends UnknownCommandNamePayload {
commandName: string;
}

export interface ICommandPayload {
message: Message;
Expand Down

0 comments on commit 3dbcffd

Please sign in to comment.