1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-06 19:00:50 +00:00
Files
musix-oss/src/funcs/exe.js
2024-02-10 09:33:59 +02:00

21 lines
765 B
JavaScript

module.exports = function (msg, args, client, command) {
const permissions = msg.channel.permissionsFor(client.user);
if (!permissions.has("EMBED_LINKS"))
return msg.channel.send(client.messages.noPermsEmbed);
if (!permissions.has("USE_EXTERNAL_EMOJIS"))
return msg.channel.send(client.messages.noPermsUseExternalEmojis);
if (
command.category === "music" &&
client.global.db.guilds[msg.guild.id].blacklist.includes(msg.channel.id)
)
return msg.channel.send(client.messages.musicCommandsDisabled);
try {
command.uses++;
command.execute(msg, args, client, command);
} catch (error) {
msg.reply(client.messages.errorExe);
console.log(error.toString());
console.log(error.stack.replace(/at /g, "**at **"));
}
};