From 3da955739b9794865467257aa26562c6c81bc17f Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 11 Feb 2022 18:50:18 +0100 Subject: Fix: /eval is now ignored from commands stats (#5) --- commands/info.js | 8 ++++++-- config/version.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/commands/info.js b/commands/info.js index 14088f4..77082bf 100644 --- a/commands/info.js +++ b/commands/info.js @@ -55,9 +55,13 @@ module.exports = async (interaction) => { let statsCommand = "-"; let statsCommandUsage = "n/a"; + + let statsCommandsP = statsCommands + try { delete statsCommandsP["eval"]; } catch (e) {} + try { - statsCommand = Object.keys(statsCommands).reduce((a, b) => statsCommands[a] > statsCommands[b] ? a : b); - statsCommandUsage = statsCommands[Object.keys(statsCommands).reduce((a, b) => statsCommands[a] > statsCommands[b] ? a : b)].toString(); + statsCommand = Object.keys(statsCommandsP).reduce((a, b) => statsCommandsP[a] > statsCommandsP[b] ? a : b); + statsCommandUsage = statsCommandsP[Object.keys(statsCommandsP).reduce((a, b) => statsCommandsP[a] > statsCommandsP[b] ? a : b)].toString(); } catch (e) { console.error(e); } diff --git a/config/version.txt b/config/version.txt index e937bfd..973c154 100644 --- a/config/version.txt +++ b/config/version.txt @@ -1 +1 @@ -1.3.41 \ No newline at end of file +1.3.42 \ No newline at end of file -- cgit