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
+1
View File
@@ -6,6 +6,7 @@ const { Intents, MessageEmbed } = require('discord.js');
const Client = require('./structures/Client');
const client = new Client({
commandPrefix: XIAO_PREFIX,
mentionPrefix: false,
owner: OWNERS.split(','),
invite: INVITE,
allowedMentions: {
+1
View File
@@ -12,6 +12,7 @@ module.exports = class CommandClient extends Client {
super(options);
this.commandPrefix = options.commandPrefix;
this.mentionPrefix = typeof options.mentionPrefix === 'undefined' ? true : Boolean(options.mentionPrefix);
this.owner = typeof options.owner === 'string' ? [options.owner] : options.owner;
this.invite = options.invite || null;
this.registry = new Registry(this);
+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;
}