eximiabots-radiox/struct/funcs/exe.js

17 lines
871 B
JavaScript
Raw Normal View History

2020-03-02 19:38:42 +00:00
module.exports = function (msg, args, client, Discord, prefix, command) {
const permissions = msg.channel.permissionsFor(msg.client.user);
if (!permissions.has('EMBED_LINKS')) return msg.channel.send('<:redx:674263474704220182> I cannot send embeds (Embed links), make sure I have the proper permissions!');
try {
command.uses++;
command.execute(msg, args, client, Discord, prefix, command);
} catch (error) {
msg.reply(`<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with \`${prefix}bug\`!`);
const embed = new Discord.MessageEmbed()
.setTitle(`Musix ${error.toString()}`)
.setDescription(error.stack.replace(/at /g, '**at **'))
.setColor('#b50002');
2020-03-07 20:07:54 +00:00
client.debug_channel.send(embed);
2020-03-02 19:38:42 +00:00
console.error(error);
}
};