No mention prefix

This commit is contained in:
Dragon Fire
2021-06-06 14:59:34 -04:00
parent 7f28501b47
commit ef1253f87f
3 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -11,8 +11,9 @@ module.exports = class CommandDispatcher {
get commandPattern() {
if (this._commandPattern) return this._commandPattern;
const prefix = this.client.commandPrefix;
const mention = `<@!?${this.client.user.id}>\\s+(?:${prefix}}\\s*)?|`;
this._commandPattern = new RegExp(
`^(<@!?${this.client.user.id}>\\s+(?:${prefix}}\\s*)?|${prefix}\\s*)([^\\s]+)`, 'i'
`^(${this.client.mentionPrefix ? mention : ''}${prefix}\\s*)([^\\s]+)`, 'i'
);
return this._commandPattern;
}