1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 07:41:56 +00:00
musix-oss/Struct/funcs/exe.js

17 lines
934 B
JavaScript
Raw Normal View History

module.exports = function (message, args, client, Discord, prefix, command) {
const permissions = message.channel.permissionsFor(message.client.user);
if (!permissions.has('EMBED_LINKS')) return message.channel.send(':x: I cannot send embeds (Embed links), make sure I have the proper permissions!');
try {
2019-11-25 18:48:56 +00:00
command.uses++;
command.execute(message, args, client, Discord, prefix);
} catch (error) {
message.reply(`:x: there was an error trying to execute that command! Please contact support with \`${prefix}bug\`!`);
const embed = new Discord.RichEmbed()
.setTitle(`Musix ${error.toString()}`)
.setDescription(error.stack.replace(/at /g, '**at **'))
.setColor('#b50002');
2019-10-31 21:47:17 +00:00
client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error);
2019-10-31 19:08:45 +00:00
client.channels.get(client.config.debug_channel).send(embed);
}
2019-10-31 19:08:45 +00:00
};