Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
fix: don't warn user about execution time
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbegby committed Jul 24, 2023
1 parent 57bc6c8 commit 3b842f3
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/events/interactions/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,9 @@ module.exports = {
const executionTime = outputTime - inputTime;

if (executionTime > 20000) {
// don't send warning message for commands with collector timeouts, as collector timeout happens after 60 seconds
if (
(interaction.commandName === 'filters' || interaction.commandName === 'nowplaying') &&
executionTime > 55000
) {
logger.info(
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' executed in ${executionTime} ms.`
);
return;
}

logger.warn(
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' took ${executionTime} ms to execute.`
);

return await interaction.followUp({
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Warning**\nThis command took ${
executionTime / 1000
} seconds to execute.\n\n_If you experienced problems with the command, please try again._`
)
.setColor(embedOptions.colors.warning)
]
});
} else {
logger.info(
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' executed in ${executionTime} ms.`
Expand Down

0 comments on commit 3b842f3

Please # to comment.