Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
fix(CommandHandler): properly handle spaces after the prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC authored Feb 4, 2023
1 parent 5474026 commit 4451935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export class CommandHandler
): [Command, string, string[]] | [undefined, undefined, undefined]
{
const prefixes: string[] = guildModel.prefix ? this._prefixes.concat(guildModel.prefix) : this._prefixes;
const match: RegExpExecArray | null = new RegExp(`^(${prefixes.join(' *|')})`, 'i').exec(message.content);
const match: RegExpExecArray | null = new RegExp(`^((?:${prefixes.join(' *|')}) *)`, 'i').exec(message.content);

if (!match) return [undefined, undefined, undefined];

Expand Down

0 comments on commit 4451935

Please sign in to comment.