Add mentioning the bot as a valid prefix
This commit is contained in:
parent
2c8be96c1b
commit
482fc2a1e7
1 changed files with 4 additions and 1 deletions
|
@ -7,7 +7,10 @@ module.exports = function(client, owners, message, globalPrefix){
|
|||
if (serverPrefix) {
|
||||
prefix = serverPrefix;
|
||||
}
|
||||
|
||||
if(message.content.startsWith(`<@${client.user.id}>`)){
|
||||
let regex = new RegExp("(<@" + client.user.id + ">) *")
|
||||
message.content = message.content.replace(regex, prefix);
|
||||
}
|
||||
let args = message.content.slice(prefix.length).split(" ")
|
||||
|
||||
const commandName = args.shift().toLowerCase();
|
||||
|
|
Loading…
Add table
Reference in a new issue