mirror of
https://github.com/musix-org/musix-oss
synced 2025-08-02 12:24:35 +00:00
Option handler for playlists and settings. Exe function to execute command files. Command aliases updated.
This commit is contained in:
15
funcs/exe.js
Normal file
15
funcs/exe.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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 {
|
||||
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');
|
||||
client.fetchUser(client.global.devId).then(user => user.send(embed)).catch(console.error);
|
||||
client.channels.get('634718645188034560').send(embed);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user