From 6e68fe604b0e904f3adfbf5277a62758ab5e8969 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 9 Jul 2023 21:53:01 +0200 Subject: [PATCH] Don't send execution time warning for /filters command above 55 seconds --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index 952cf1e..8f90e7b 100644 --- a/index.js +++ b/index.js @@ -127,6 +127,18 @@ client.on('interactionCreate', async (interaction) => { const executionTime = outputTime - inputTime; if (executionTime > 20000) { + // don't send warning message for filters command, as collector timeout happens after 60 seconds + if (command.name === 'filters' && executionTime > 55000) { + console.log( + `${new Date().toISOString().substring(11, 19)}: Info: ${ + interaction.guild.name + } (#${ + interaction.guild.memberCount + })> Command '${interaction}' executed in ${executionTime} ms.` + ); + return; + } + console.log( `${new Date().toISOString().substring(11, 19)}: Warning: ⚠️ ${ interaction.guild.name