From 804423f2a1f1425ba3f868db8931e20aae2941d1 Mon Sep 17 00:00:00 2001 From: NoBody Date: Sun, 7 Jul 2024 09:15:44 -0500 Subject: [PATCH] fix: indexAttachment bug in handleCommand (#218) --- src/commands/handle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/handle.ts b/src/commands/handle.ts index d79d7e0..d077e55 100644 --- a/src/commands/handle.ts +++ b/src/commands/handle.ts @@ -575,10 +575,10 @@ export class HandleCommand { ) { const options: APIApplicationCommandInteractionDataOption[] = []; const errors: { name: string; error: string; fullError: MessageCommandOptionErrors }[] = []; + let indexAttachment = -1; for (const i of (command.options ?? []) as (CommandOption & { type: ApplicationCommandOptionType })[]) { try { let value: string | boolean | number | undefined; - let indexAttachment = -1; switch (i.type) { case ApplicationCommandOptionType.Attachment: if (message.attachments[++indexAttachment]) {