diff options
author | Minteck <contact@minteck.org> | 2022-02-10 23:27:05 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-02-10 23:27:05 +0100 |
commit | a7d6b3f75056445d86fbf1cdbc4b4b9d9194e8dc (patch) | |
tree | afc457d7fcad727d22d501fdbd77da618a4b3638 | |
parent | 3e1e5747e19c605b21288bc0eae524c08934dade (diff) | |
download | ponyfind-a7d6b3f75056445d86fbf1cdbc4b4b9d9194e8dc.tar.gz ponyfind-a7d6b3f75056445d86fbf1cdbc4b4b9d9194e8dc.tar.bz2 ponyfind-a7d6b3f75056445d86fbf1cdbc4b4b9d9194e8dc.zip |
Show stats clearer
-rw-r--r-- | commands/info.js | 8 | ||||
-rw-r--r-- | config/version.txt | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/commands/info.js b/commands/info.js index ac2846f..14088f4 100644 --- a/commands/info.js +++ b/commands/info.js @@ -54,15 +54,19 @@ module.exports = async (interaction) => { let sizep = bytesToPretty(size); let statsCommand = "-"; + let statsCommandUsage = "n/a"; 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(); } catch (e) { console.error(e); } let statsPony = "-"; + let statsPonyUsage = "n/a"; try { statsPony = Object.keys(statsPonies).reduce((a, b) => statsPonies[a] > statsPonies[b] ? a : b); + statsPonyUsage = statsPonies[Object.keys(statsPonies).reduce((a, b) => statsPonies[a] > statsPonies[b] ? a : b)].toString(); } catch (e) { console.error(e); } @@ -72,8 +76,8 @@ module.exports = async (interaction) => { { name: l("Kernel version", "Version du noyau", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: process.version, inline: true }, { name: l("Experience channel", "Canal d'expériences", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: channel, inline: true }, { name: l("Known ponies", "Poneys connus", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: Object.keys(JSON.parse(fs.readFileSync("./data/data.json").toString())).length.toString(), inline: true }, - { name: l("Most used command", "Commande la plus utilisée", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: "/" + statsCommand, inline: true }, - { name: l("Most viewed pony", "Poney le plus consulté", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: statsPony, inline: true }, + { name: l("Most used command", "Commande la plus utilisée", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: "`/" + statsCommand + "`\n(" + l("used " + statsCommandUsage + " times", "utilisée " + statsCommandUsage + " fois", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + ")", inline: true }, + { name: l("Most viewed pony", "Poney le plus consulté", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: statsPony + "\n(" + l("viewed " + statsPonyUsage + " times", "consulté " + statsPonyUsage + " fois", interaction.user.id, interaction.guild ? interaction.guild.id : 0) + ")", inline: true }, { name: l("Awaiting issue reports", "Rapports de problèmes en attente", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: fs.readdirSync("./reports").length.toString(), inline: true }, { name: l("Database size", "Taille de la base de données", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: sizep, inline: true }, { name: l("Memory usage", "Utilisation de la mémoire", interaction.user.id, interaction.guild ? interaction.guild.id : 0), value: bytesToPretty(process.memoryUsage().rss + process.memoryUsage().heapTotal + process.memoryUsage().external + process.memoryUsage().arrayBuffers, interaction.user.id, interaction.guild ? interaction.guild.id : 0), inline: true }, diff --git a/config/version.txt b/config/version.txt index adf1ebc..84da421 100644 --- a/config/version.txt +++ b/config/version.txt @@ -1 +1 @@ -1.2.38
\ No newline at end of file +1.2.39
\ No newline at end of file |