Don't send execution time warning for /filters command above 55 seconds

This commit is contained in:
Marius Begby committed 2023-07-09 21:53:01 +02:00
1 parent 81a7415419
commit 6e68fe604b
1 file changed
+12
+12
View File
@@ -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