Skip to content

Multiple autocomplete is not working #1274

Answered by nevstas
nevstas asked this question in Q&A
Discussion options

You must be logged in to vote

I have found solution:

$discord->listenCommand(['price'], function (Interaction $interaction) {
    //run command
    $weapon = $interaction->data->options->offsetGet('weapon')?->value;
    $skin = $interaction->data->options->offsetGet('skin')?->value;
    $condition = $interaction->data->options->offsetGet('condition')?->value;
    $stattrak = $interaction->data->options->offsetGet('stattrak')?->value;
}, function (Interaction $interaction) use ($discord) {
    Log::channel('single')->debug('Autocomplete triggered');
    Log::channel('single')->debug(json_encode($interaction->data->options));

    $focusedOption = null;
    foreach ($interaction->data->options as $option) {
        if (…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nevstas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants