mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-04-19 10:04:49 +00:00
20 lines
707 B
JavaScript
20 lines
707 B
JavaScript
module.exports = {
|
|
name: 'interactionCreate',
|
|
async execute(client, interaction, Discord) {
|
|
if (!interaction.isCommand()) return;
|
|
|
|
const commandName = interaction.commandName;
|
|
const command = client.commands.get(commandName);
|
|
if (!command) return;
|
|
const permissions = interaction.channel.permissionsFor(interaction.client.user);
|
|
if (!permissions.has('EMBED_LINKS')) return interaction.send(client.messages.noPermsEmbed);
|
|
|
|
try {
|
|
command.execute(interaction, client, Discord, command);
|
|
} catch (error) {
|
|
interaction.reply(client.messages.runningCommandFailed);
|
|
console.error(error);
|
|
}
|
|
}
|
|
}
|