mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: indexAttachment bug in handleCommand (#218)
This commit is contained in:
parent
a6dae32aaf
commit
804423f2a1
@ -575,10 +575,10 @@ export class HandleCommand {
|
|||||||
) {
|
) {
|
||||||
const options: APIApplicationCommandInteractionDataOption[] = [];
|
const options: APIApplicationCommandInteractionDataOption[] = [];
|
||||||
const errors: { name: string; error: string; fullError: MessageCommandOptionErrors }[] = [];
|
const errors: { name: string; error: string; fullError: MessageCommandOptionErrors }[] = [];
|
||||||
|
let indexAttachment = -1;
|
||||||
for (const i of (command.options ?? []) as (CommandOption & { type: ApplicationCommandOptionType })[]) {
|
for (const i of (command.options ?? []) as (CommandOption & { type: ApplicationCommandOptionType })[]) {
|
||||||
try {
|
try {
|
||||||
let value: string | boolean | number | undefined;
|
let value: string | boolean | number | undefined;
|
||||||
let indexAttachment = -1;
|
|
||||||
switch (i.type) {
|
switch (i.type) {
|
||||||
case ApplicationCommandOptionType.Attachment:
|
case ApplicationCommandOptionType.Attachment:
|
||||||
if (message.attachments[++indexAttachment]) {
|
if (message.attachments[++indexAttachment]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user