diff --git a/src/commands/info/help.js b/src/commands/info/help.js index 4fc5d5e..ca8d1ca 100644 --- a/src/commands/info/help.js +++ b/src/commands/info/help.js @@ -8,7 +8,7 @@ module.exports = { .setName('help') .setDescription('Show a list of commands and their usage.') .setDMPermission(false), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { return await interaction.editReply({ embeds: [ new EmbedBuilder() diff --git a/src/commands/player/filters.js b/src/commands/player/filters.js index 849ccb2..85e8223 100644 --- a/src/commands/player/filters.js +++ b/src/commands/player/filters.js @@ -15,7 +15,7 @@ module.exports = { .setName('filters') .setDescription('Toggle various audio filters during playback.') .setDMPermission(false), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/leave.js b/src/commands/player/leave.js index 174daef..41909ca 100644 --- a/src/commands/player/leave.js +++ b/src/commands/player/leave.js @@ -11,7 +11,7 @@ module.exports = { .setDMPermission(false), // todo, allow command to be executed if bot is only member in voice channel - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/loop.js b/src/commands/player/loop.js index 1e50b7d..5a4081c 100644 --- a/src/commands/player/loop.js +++ b/src/commands/player/loop.js @@ -21,7 +21,7 @@ module.exports = { { name: 'Disabled', value: '0' } ) ), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/nowplaying.js b/src/commands/player/nowplaying.js index bff4a60..750bfa9 100644 --- a/src/commands/player/nowplaying.js +++ b/src/commands/player/nowplaying.js @@ -9,7 +9,7 @@ module.exports = { .setName('nowplaying') .setDescription('Show information about the track currently playing.') .setDMPermission(false), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/pause.js b/src/commands/player/pause.js index 3a7128a..a14c9ee 100644 --- a/src/commands/player/pause.js +++ b/src/commands/player/pause.js @@ -9,7 +9,7 @@ module.exports = { .setName('pause') .setDescription('Pause or resume the current track.') .setDMPermission(false), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/play.js b/src/commands/player/play.js index a20c65c..d3177b8 100644 --- a/src/commands/player/play.js +++ b/src/commands/player/play.js @@ -10,7 +10,7 @@ module.exports = { .setDescription('Add a track or playlist to the queue by searching or url.') .setDMPermission(false) .addStringOption((option) => option.setName('query').setDescription('Search query or URL.').setRequired(true)), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/queue.js b/src/commands/player/queue.js index dbc7330..f5a2547 100644 --- a/src/commands/player/queue.js +++ b/src/commands/player/queue.js @@ -10,7 +10,7 @@ module.exports = { .setDescription('Show the list of tracks added to the queue.') .setDMPermission(false) .addNumberOption((option) => option.setName('page').setDescription('Page number of the queue').setMinValue(1)), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/remove.js b/src/commands/player/remove.js index e660615..3a3eabb 100644 --- a/src/commands/player/remove.js +++ b/src/commands/player/remove.js @@ -16,7 +16,7 @@ module.exports = { .setMinValue(1) .setRequired(true) ), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/seek.js b/src/commands/player/seek.js index 84918b7..d7c05ae 100644 --- a/src/commands/player/seek.js +++ b/src/commands/player/seek.js @@ -15,7 +15,7 @@ module.exports = { .setDescription('Duration in format 00:00:00 (HH:mm:ss) to seek to.') .setRequired(true) ), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/skip.js b/src/commands/player/skip.js index e656abc..5b2423a 100644 --- a/src/commands/player/skip.js +++ b/src/commands/player/skip.js @@ -12,7 +12,7 @@ module.exports = { .addNumberOption((option) => option.setName('tracknumber').setDescription('Track number to skip to in the queue.').setMinValue(1) ), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/player/volume.js b/src/commands/player/volume.js index acf7b09..1cbbd8c 100644 --- a/src/commands/player/volume.js +++ b/src/commands/player/volume.js @@ -16,7 +16,7 @@ module.exports = { .setMinValue(0) .setMaxValue(100) ), - run: async ({ interaction }) => { + execute: async ({ interaction }) => { if (!interaction.member.voice.channel) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/system/guilds.js b/src/commands/system/guilds.js index 13cf5ef..f1a909d 100644 --- a/src/commands/system/guilds.js +++ b/src/commands/system/guilds.js @@ -9,7 +9,7 @@ module.exports = { .setName('guilds') .setDescription('Show list of guilds where bot is added.') .setDMPermission(false), - run: async ({ interaction, client }) => { + execute: async ({ interaction, client }) => { if (!systemServerGuildIds.includes(interaction.guildId)) { return await interaction.editReply({ embeds: [ diff --git a/src/commands/system/status.js b/src/commands/system/status.js index 1dca865..53a408f 100644 --- a/src/commands/system/status.js +++ b/src/commands/system/status.js @@ -9,7 +9,7 @@ const packageJson = require(path.resolve('./package.json')); module.exports = { isSystemCommand: true, data: new SlashCommandBuilder().setName('status').setDescription('Show bot status.').setDMPermission(false), - run: async ({ interaction, client }) => { + execute: async ({ interaction, client }) => { if (!systemServerGuildIds.includes(interaction.guildId)) { return await interaction.editReply({ embeds: [ diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js index dbddad8..69906f6 100644 --- a/src/events/interactions/interactionCreate.js +++ b/src/events/interactions/interactionCreate.js @@ -13,13 +13,16 @@ module.exports = { const command = client.commands.get(interaction.commandName); if (!command) { + logger.warn(`Interaction created but command '${interaction.commandName}' was not found.`); return; } try { const inputTime = new Date(); + await interaction.deferReply(); - await command.run({ interaction, client }); + await command.execute({ interaction, client }); + const outputTime = new Date(); const executionTime = outputTime - inputTime;