add code
This commit is contained in:
parent
f50de3e481
commit
a96e3cbd96
|
@ -26,12 +26,15 @@ client.on('message', message => {
|
|||
msgContent = msgContent.split(usedPrefix)[1];
|
||||
if (msgContent.startsWith(' ') && usedPrefix != prefix) msgContent = msgContent.substr(1, msgContent.length);
|
||||
const args = msgContent.split(' ');
|
||||
const cmdName = args.shift();
|
||||
const cmdName = args.shift()?.toLowerCase();
|
||||
|
||||
const cmd = commands.find(cmd => cmd.meta?.name == cmdName || cmd.meta?.aliases?.indexOf(cmdName) > -1);
|
||||
if (!cmd) return require('./69Reply').execute(message);
|
||||
|
||||
logger.info(`[CMD] ${message.author.id} ${message.author.tag} => ${cmdName}, ${args.join(' ')}`);
|
||||
|
||||
if (cmd.meta?.staffOnly && !message.member.permissions.has('ADMINISTRATOR')) {
|
||||
logger.warn(`${message.author.tag} => Refusing to run staff command`);
|
||||
message.channel.send(
|
||||
new Discord.MessageEmbed()
|
||||
.setTitle('You are unworthy')
|
||||
|
|
Loading…
Reference in a new issue