#Autocomplete unknown interaction

1 messages · Page 1 of 1 (latest)

quick violet
#

Ok so

violet folio
#

hah

quick violet
#

@hardy cargo so

hardy cargo
#

oh

#

hai

#

Here is what I have for autocomplete

        if (interaction.isAutocomplete() && Command.handleAutocomplete) {
            const focused_value = interaction.options.getFocused(true);
            const command_option = focused_value.name;
            const command_results = await Command.handleAutocomplete(caller, interaction, guildConfig);
            const filtered_results = command_results[command_option].filter((choice: string) =>
                choice.toLowerCase().includes(focused_value.value.toLowerCase()),
            );
            if (['host'].includes(Command.definition.name)) {
                return await interaction.respond(
                    filtered_results.slice(0, 24).map((choice: string) => {
                        const value = choice.toLowerCase().split(' - ');
                        return { name: choice, value: value.length == 1 ? value[0].replace(/ /g, '_') : value[1].replace(/ /g, '_') };
                    }),
                );
            } else
                return await interaction.respond(
                    filtered_results.slice(0, 24).map((choice: string) => ({ name: choice, value: choice.replace(/ /g, '_') })),
                );
        }
``` and in the `if (['host']` where it returns is where it specifically fails.
violet folio
#

this error is annoying

hardy cargo
#

agreed

quick violet
#

What’s handleAutocomplete()? Do you do any database retrievals? If so sone sorta caching system seems better

hardy cargo
#

on beta, it works 110% perfectly and does the do exactly how i want, but i finally launch this rewrite live and it's just constant error after error

#

not on this command

#

but one second

#

oh, well it was so big it auto-filed

#

(yes, this is runescape, give me shit for it later)

quick violet
#

Could possibly be that it’s just taking too long

#

I’m not too sure how to make this “quicker”

hardy cargo
#

what if

quick violet
hardy cargo
#

where it says return await interaction.respond, is return await interaction.defer a thing?

#

and would that give it more time to do the do?

quick violet
#

You can’t defer autocomplete interactions

hardy cargo
#

i didn't think so

#

i am beyond upset, lol.

hardy cargo
#

we've been working on getting this live and migrating information over since 10:30 this morning and it's now almost 7pm

#

i just want this to work

#

😭

quick violet
#

There’s a lot of splitting etc going on

hardy cargo
#

could that slow it down that much?

#

and why would it work on beta instance but then not on main?

#

i had beta in 50+ servers with people spamming it and it was fine, i send it live and just poof

quick violet
#

I doubt. Could also get a better host with a better connection

hardy cargo
#

ah

quick violet
hardy cargo
#

local host vs vps

#

....that actually could be

quick violet
#

vps should have a better connection ofc

hardy cargo
#

should, but this is me you're talking to

#

my luck never works out that way

quick violet
#

I feel you

hardy cargo
#

well thanks anyways

#

i appreciate your time

quick violet
#

All good bro good luck

hardy cargo
# quick violet There’s a lot of splitting etc going on

just as a heads up, i went back and included what was being split off to the options and removed the "host" part of that check where it all runs on that else part and commented out the top part, so far, no issues and it's been up for almost 20 minutes

#

oop, i didn't mean to reopen this. that's my bad

quick violet
#

It’s all good

hardy cargo
#

was just reporting back good news

#

so far, so good, at least

quick violet
#

It’s good lol. Nice work

hardy cargo
#

so i guess it was taking too much time to run through all that little bit of an extra step

#

and thank you

#

i'm finished, off to bug hunt another issue, and i already know this one, lol

#

thanks again k baiii

quick violet
#

I got 100’s 💀

hardy cargo
#

wot

quick violet
#

Exaggerating don’t worry 😭

#

I got a few though

hardy cargo
#

lol