fix: indexAttachment bug in handleCommand (#218)

This commit is contained in:
NoBody 2024-07-07 09:15:44 -05:00 committed by GitHub
parent a6dae32aaf
commit 804423f2a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]) {