From de540a2a8a033b8632e2a0593cf653ea2f337a15 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 11 Sep 2021 21:44:01 +0300 Subject: [PATCH] Add count parameter to rest_performance --- .../src/plugins/BotControl/commands/RestPerformanceCmd.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts b/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts index da28749c..5ec1fba0 100644 --- a/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts +++ b/backend/src/plugins/BotControl/commands/RestPerformanceCmd.ts @@ -11,9 +11,12 @@ export const RestPerformanceCmd = botControlCmd({ trigger: ["rest_performance"], permission: "can_performance", - signature: {}, + signature: { + count: ct.number({ required: false }), + }, async run({ pluginData, message: msg, args }) { + const count = Math.max(1, Math.min(25, args.count || 5)); const stats = getTopRestCallStats(5); const formatted = stats.map((callStats) => { const cleanSource = callStats.source.replace(leadingPathRegex, "");