From 0b1c4da0cead8a10d5059f8e1bf3c8d31947b7c6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 27 May 2021 08:36:46 -0400 Subject: [PATCH] Add /stats command --- commands.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/commands.js b/commands.js index 7b5f5d1..0cf7cf7 100644 --- a/commands.js +++ b/commands.js @@ -186,6 +186,21 @@ export default { client.send({ command: "SETNAME", params: [newRealname] }); }, }, + "stats": { + usage: " []", + description: "Requests server statistics", + execute: (app, args) => { + var query = args[0]; + if (!query) { + throw new Error("Missing query"); + } + var params = [query]; + if (args.length > 1) { + params.push(args.slice(1).join(" ")); + } + getActiveClient(app).send({ command: "STATS", params }); + }, + }, "topic": { usage: "", description: "Change the topic of the current channel",