1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 02:00:20 +00:00

Mention commands

This commit is contained in:
MatteZ02 2020-05-13 12:52:12 +03:00
parent 8810b6c01c
commit 161b88d020

View File

@ -16,13 +16,16 @@ module.exports = {
);
if (args[2] === "=" && args[3]) return (prefix = args[3]);
}
if (args[1] === "help") {
const command = client.commands.get("help");
return client.funcs.exe(msg, args, client, Discord, prefix, command);
}
args.shift();
getCommand(client, args, msg, Discord);
}
}
if (!msg.content.startsWith(prefix)) return;
getCommand(client, args, msg, Discord);
},
};
function getCommand(client, args, msg, Discord) {
if (!args[0]) return;
const commandName = args[0].toLowerCase();
if (commandName === "none") return;
@ -32,10 +35,9 @@ module.exports = {
(cmd) => cmd.aliases && cmd.aliases.includes(commandName)
) ||
client.commandAliases.get(commandName);
if (!command && msg.content !== `${prefix}`) return;
if (!command) return;
if (command.onlyDev && msg.author.id !== client.config.devId) return;
if (client.config.devMode && msg.member.id !== client.config.devId)
return msg.channel.send(client.messages.devMode);
client.funcs.exe(msg, args, client, Discord, command);
},
};
}