mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 03:33:17 +00:00
26 lines
1.4 KiB
JavaScript
26 lines
1.4 KiB
JavaScript
module.exports = {
|
|
name: 'message',
|
|
async execute(client, message, Discord) {
|
|
if (message.author.bot || !message.guild) return;
|
|
let prefix = client.global.db.guilds[message.guild.id].prefix;
|
|
const args = message.content.slice(prefix.length).split(' ');
|
|
if (message.mentions.users.first()) {
|
|
if (message.mentions.users.first().id === client.user.id) {
|
|
if (!args[1]) return;
|
|
if (args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`);
|
|
if (args[1] === 'help') {
|
|
const command = client.commands.get("help");
|
|
return client.funcs.exe(message, args, client, Discord, prefix, command);
|
|
}
|
|
}
|
|
}
|
|
if (!message.content.startsWith(prefix)) return;
|
|
if (!args[0]) return;
|
|
const commandName = args[0].toLowerCase();
|
|
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
|
|
if (!command && message.content !== `${prefix}`) return;
|
|
if (command.onlyDev && message.author.id !== client.config.dev) return message.channel.send(':x: You are not allowed to do that!');
|
|
client.funcs.exe(message, args, client, Discord, prefix, command);
|
|
}
|
|
}
|