From 9a9d2a76dd6ab0f81149283bd060506555a94afc Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 28 Jan 2024 12:08:00 +0100 Subject: [PATCH 1/2] Updated commands and add min and max length --- src/commands/check.ts | 2 ++ src/commands/guild.ts | 2 ++ src/commands/uuid.ts | 2 ++ src/commands/verify.ts | 4 +++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands/check.ts b/src/commands/check.ts index 2ef1de4..db04735 100644 --- a/src/commands/check.ts +++ b/src/commands/check.ts @@ -17,6 +17,8 @@ export = { option .setName("ign") .setDescription("The player's IGN.") + .setMinLength(3) + .setMaxLength(16) .setRequired(true) ) .setDMPermission(false), diff --git a/src/commands/guild.ts b/src/commands/guild.ts index 0c46f8b..9264f3f 100644 --- a/src/commands/guild.ts +++ b/src/commands/guild.ts @@ -23,6 +23,8 @@ export = { option .setName("ign") .setDescription("The IGN of the player.") + .setMinLength(3) + .setMaxLength(16) .setRequired(true) ) ) diff --git a/src/commands/uuid.ts b/src/commands/uuid.ts index 557fbe8..ab744ec 100644 --- a/src/commands/uuid.ts +++ b/src/commands/uuid.ts @@ -16,6 +16,8 @@ export = { option .setName("ign") .setDescription("Player's name") + .setMinLength(3) + .setMaxLength(16) .setRequired(true) ) .setDMPermission(false), diff --git a/src/commands/verify.ts b/src/commands/verify.ts index df2a4c7..bf1587e 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -11,7 +11,7 @@ import { GuildData } from "interfaces" export = { name: "verify", description: "Verify yourself as a member of the server.", - dev: false, + dev: true, public: true, data: new SlashCommandBuilder() @@ -21,6 +21,8 @@ export = { option .setName("ign") .setDescription("Your in-game name.") + .setMinLength(3) + .setMaxLength(16) .setRequired(true) ) .setDMPermission(false), From a3625e2e3fa8419cbfa0b3cc6ec71ca83cb65274 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 28 Jan 2024 12:09:27 +0100 Subject: [PATCH 2/2] Updated autodeploy script --- src/utils/Autodeploy.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/Autodeploy.ts b/src/utils/Autodeploy.ts index d944d8a..4dacb1b 100644 --- a/src/utils/Autodeploy.ts +++ b/src/utils/Autodeploy.ts @@ -95,12 +95,13 @@ export default async function autoDeployCommands(fileType: FileType, client: Ext } for (const cmd of commandData) { - const currentCommand = currentCommandsData.find(c => c.name === cmd.name)! - const newCmd = commands.find(c => c.name === cmd.name)! - const currentCommandID = currentCommands.find(c => c.name === cmd.name)!.id + if (!currentCommandsData.find(c => c.name === cmd.name)) continue - if (JSON.stringify(cmd) !== JSON.stringify(currentCommand)) { - await guildclient.commands.edit(currentCommandID, newCmd) + const currentCommand = currentCommands.find(c => c.name === cmd.name)! + const currentCommandData = currentCommandsData.find(c => c.name === cmd.name)! + + if (JSON.stringify(cmd) !== JSON.stringify(currentCommandData)) { + await guildclient.commands.edit(currentCommand.id, cmd) console.log(color(" " + cmd.name + " was updated.", "lavender")) } }