From bd97ab5d656fe442f11c2b721888fef2f784ab82 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sat, 12 Aug 2023 18:02:46 +0200 Subject: [PATCH 1/4] asd --- src/events/interactions/interactionCreate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js index d62ff34..43e9b44 100644 --- a/src/events/interactions/interactionCreate.js +++ b/src/events/interactions/interactionCreate.js @@ -29,6 +29,7 @@ module.exports = { return; } } else if (interaction.isChatInputCommand()) { + logger.info('[Shard ${interaction.guild.shardId}] Interaction created.'); try { if (await cannotSendMessageInChannel(interaction)) { return; From 529bfdde9c6de25e9a9ae574143b42d5462dfa0d Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sat, 12 Aug 2023 18:06:21 +0200 Subject: [PATCH 2/4] asdfasdf --- src/events/interactions/interactionCreate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js index 43e9b44..56b8dec 100644 --- a/src/events/interactions/interactionCreate.js +++ b/src/events/interactions/interactionCreate.js @@ -16,6 +16,7 @@ module.exports = { } if (interaction.isAutocomplete()) { + logger.info(`[Shard ${interaction.guild.shardId}] Autocomplete created.`); try { await command.autocomplete({ interaction, client }); } catch (error) { @@ -29,7 +30,7 @@ module.exports = { return; } } else if (interaction.isChatInputCommand()) { - logger.info('[Shard ${interaction.guild.shardId}] Interaction created.'); + logger.info(`[Shard ${interaction.guild.shardId}] Interaction created.`); try { if (await cannotSendMessageInChannel(interaction)) { return; From 7527f8150c29bfb3b1fa37581a39f0fc09ed8ff3 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sat, 12 Aug 2023 18:14:23 +0200 Subject: [PATCH 3/4] asdasd --- src/events/interactions/interactionCreate.js | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js index 56b8dec..73779ad 100644 --- a/src/events/interactions/interactionCreate.js +++ b/src/events/interactions/interactionCreate.js @@ -20,13 +20,17 @@ module.exports = { try { await command.autocomplete({ interaction, client }); } catch (error) { - if (error.message === 'Unknown interaction') { + if ( + error.message === 'Unknown interaction' || + error.message === 'Interaction has already been acknowledged.' + ) { logger.debug( - `[Shard ${interaction.guild.shardId}] Autocomplete failed to be responded to, providing a response took too long.` + `[Shard ${interaction.guild.shardId}] Autocomplete failed to be responded to, unknown interaction or already acknowledged.` ); return; + } else { + logger.warn(error, `[Shard ${interaction.guild.shardId}] Autocomplete failed to execute.`); } - logger.warn(error, `[Shard ${interaction.guild.shardId}] Autocomplete failed to execute.`); return; } } else if (interaction.isChatInputCommand()) { @@ -53,21 +57,14 @@ module.exports = { ); } } catch (error) { - logger.error( + logger.warn( error, - `[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' failed to execute.` + `[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' throwed and error and might have failed to execute properly.` ); if (interaction.replied) { - await interaction.followUp({ - embeds: [ - new EmbedBuilder() - .setDescription( - `**${embedOptions.icons.error} Uh-oh... _Something_ went wrong!**\nThere was an unexpected error while trying to execute this command.\n\nYou can try to perform the command again.\n\n_If this problem persists, please submit a bug report in the **[support server](${botOptions.serverInviteUrl})**._` - ) - .setColor(embedOptions.colors.error) - ] - }); + // If the interaction has already been replied to, most likely command executed successfully or error is already handled. + return; } else if (interaction.deferred) { await interaction.editReply({ embeds: [ From fcf8724e88d93f7a47d4bb1e17c7c66547201755 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sat, 12 Aug 2023 18:18:14 +0200 Subject: [PATCH 4/4] fdasfdf --- src/events/interactions/interactionCreate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/interactions/interactionCreate.js b/src/events/interactions/interactionCreate.js index 73779ad..5ee71e3 100644 --- a/src/events/interactions/interactionCreate.js +++ b/src/events/interactions/interactionCreate.js @@ -16,7 +16,7 @@ module.exports = { } if (interaction.isAutocomplete()) { - logger.info(`[Shard ${interaction.guild.shardId}] Autocomplete created.`); + logger.debug(`[Shard ${interaction.guild.shardId}] Autocomplete created.`); try { await command.autocomplete({ interaction, client }); } catch (error) { @@ -34,7 +34,7 @@ module.exports = { return; } } else if (interaction.isChatInputCommand()) { - logger.info(`[Shard ${interaction.guild.shardId}] Interaction created.`); + logger.debug(`[Shard ${interaction.guild.shardId}] Interaction created.`); try { if (await cannotSendMessageInChannel(interaction)) { return;