1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 18:03:17 +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,26 +16,28 @@ 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;
if (!args[0]) return;
const commandName = args[0].toLowerCase();
if (commandName === "none") return;
const command =
client.commands.get(commandName) ||
client.commands.find(
(cmd) => cmd.aliases && cmd.aliases.includes(commandName)
) ||
client.commandAliases.get(commandName);
if (!command && msg.content !== `${prefix}`) 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);
getCommand(client, args, msg, Discord);
},
};
function getCommand(client, args, msg, Discord) {
if (!args[0]) return;
const commandName = args[0].toLowerCase();
if (commandName === "none") return;
const command =
client.commands.get(commandName) ||
client.commands.find(
(cmd) => cmd.aliases && cmd.aliases.includes(commandName)
) ||
client.commandAliases.get(commandName);
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);
}