eximiabots-radiox/events/msg.js

15 lines
696 B
JavaScript
Raw Normal View History

2020-03-02 19:38:42 +00:00
module.exports = {
name: 'message',
async execute(client, msg, Discord) {
if (msg.author.bot || !msg.guild) return;
2020-03-08 14:22:00 +00:00
let prefix = client.config.prefix;
2020-03-02 19:38:42 +00:00
const args = msg.content.slice(prefix.length).split(' ');
if (!msg.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 && msg.content !== `${prefix}`) return;
client.funcs.exe(msg, args, client, Discord, prefix, command);
}
}