From c537c1c9e69261c89b5152a5af0b1bd3f2d12345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Fri, 9 Sep 2022 11:36:24 +0200 Subject: [PATCH] Debug: Add optional userid parameter Implemented for reset_cd to allow resetting other users cooldowns --- commands/debug.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/commands/debug.js b/commands/debug.js index 3ef791d..5f7110f 100644 --- a/commands/debug.js +++ b/commands/debug.js @@ -12,6 +12,12 @@ module.exports = { .setName("feature") .setDescription("The command to debug") .setRequired(false) + ) + .addStringOption((option) => + option + .setName("userid") + .setDescription("Discord ID") + .setRequired(false) ), permissionLevel: 2, async execute(interaction) { @@ -63,11 +69,12 @@ module.exports = { }); break; case "reset_cd": - await UserUtils.setCooldown(user, "pull", 1); - await UserUtils.setCooldown(user, "drop", 1); - await UserUtils.setCooldown(user, "daily", 1); + let extUser = await UserUtils.getUserByDiscordId(interaction.options.getString("userid")); + await UserUtils.setCooldown(extUser, "pull", 1); + await UserUtils.setCooldown(extUser, "drop", 1); + await UserUtils.setCooldown(extUser, "daily", 1); interaction.reply({ - content: `Reset cooldowns`, + content: `Reset cooldowns for <@${extUser.discordId}>`, ephemeral: false }); break;