Add mentioning the bot as a valid prefix

This commit is contained in:
SileNce5k 2024-03-03 15:04:35 +01:00
parent 2c8be96c1b
commit 482fc2a1e7
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -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();