From 9630f0227545b5a85f3cec343c27d2867682146a Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 27 Jul 2025 13:48:25 -0600 Subject: [PATCH] socketstats: sort --- src/modules/bot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/bot.js b/src/modules/bot.js index 765a16c..d3e2237 100644 --- a/src/modules/bot.js +++ b/src/modules/bot.js @@ -227,7 +227,9 @@ socketstats.category = CATEGORY; socketstats.helpText = "List the counts of socket events this session"; socketstats.callback = function () { let out = "```c\n"; - for (const [event, count] of Object.entries(hf.event_stats)) { + const events = Object.entries(hf.event_stats); + events.sort((a, b) => b[1] - a[1]); + for (const [event, count] of events) { out += `"${event}": ${count}\n`; } out += "```";