#Need help with autocomplete interaction

1 messages · Page 1 of 1 (latest)

smoky narwhal
#

also can u show full error? you didn't show the top of it in your screenshot

flint patio
#

okey

smoky narwhal
#

abc

worldly mortar
#

abc 🤔

flint patio
smoky narwhal
# flint patio

console.log(interaction) (it's probably not an Interaction)

small edgeBOT
#

Tag suggestion for @flint patio:
The order of function parameters must match between definition and function call.

function execute(client, message, args) { ... };
execute(message, client, args);

• mismatch! you pass a Message where the client is expected
• mismatch! you pass the Client where a Message is expected

flint patio
#

not very understandable. so how do i do it?
@worldly mortar

smoky narwhal
#

also see tag sent by wheelchair user (translate it)

flint patio
#

auto_complete

smoky narwhal
flint patio
#

I didn't understand anything of what you said. I already do most things by looking at the documentation.

#

hımm

smoky narwhal
#

no, it seems that you are responding to autocomplete interaction with reply/message, while it expects you to send the CHOICES to the user to select.

flint patio
#

I understood. So what do I do to fix this problem?

smoky narwhal
flint patio
#

I more or less understood. So the problem is elsewhere?

#
module.exports = interaction => {

    if (interaction.commandName == "yardım") {

        const focusedValue = interaction.options.getFocused()

        const choices = Array.from(interaction.client.commands.keys())

        const filtered = choices.filter(choice => choice.startsWith(focusedValue))
        const result = filtered.map(choice => ({ name: choice, value: choice }))
        interaction.respond(result)
    }

}
``` @smoky narwhal
#

Is that the problem here?

smoky narwhal
flint patio
#

ah

#

how do you say it?

#

I call AutoComplete here. So I guess the problem is here.

#

@smoky narwhal

#

you here?

smoky narwhal
#

Need help with autocomplete interaction

flint patio
#

@smoky narwhal

#

pls help me 😦

smoky narwhal
#

you need to help yourself

flint patio
#

?

#

dude it's been 1 hour i still can't figure it out

smoky narwhal
#

use the guide

#

for the 3rd time or whatever

#

use the guide to get an understanding of it and then look at what you're doing differently

flint patio
#

My friends and I struggled to solve the problem and
We looked at the document but couldn't find it.

smoky narwhal
smoky narwhal
flint patio
#

hemmm

flint patio
#

wait

smoky narwhal
#

I told you this already

#

AutocompleteInteraction (your interaction in this case) don't have a reply() method

autocompleteinteraction => .respond() with choices => then you are probably doing .execute() (in your command handler) and replying to the ChatInputCommandInteraction (the slash command interaction)

flint patio
#

Got it I guess. So how can I fix this?

#

@smoky narwhal

smoky narwhal
flint patio
#

Return?

#

THANKKKKSS