You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have command "price".
I have params "weapon", "skin", "condition", "stattrak".
I want to add multiple autocomplete to these fields: "weapon", "skin", "condition"
But my code is not working. I think because of sequence fields in listenCommand method.
Here is my code:
$discord->listenCommand(['price', 'weapon'], function (Interaction $interaction) {
//run command
}, function (Interaction $interaction) use ($discord) {
//autocomplete
$choices_obj = [];
$choices_obj[] = new Choice($discord, ['name' => 'asd1', 'value' => 'asd1']);
$choices_obj[] = new Choice($discord, ['name' => 'asd2', 'value' => 'asd2']);
return $choices_obj;
});
$discord->listenCommand(['price', 'skin'], function (Interaction $interaction) {
}, function (Interaction $interaction) use ($discord) {
//autocomplete
$choices_obj = [];
$choices_obj[] = new Choice($discord, ['name' => 'asd3', 'value' => 'asd3']);
$choices_obj[] = new Choice($discord, ['name' => 'asd4', 'value' => 'asd4']);
return $choices_obj;
});
$discord->listenCommand(['price', 'condition'], function (Interaction $interaction) {
}, function (Interaction $interaction) use ($discord) {
//autocomplete
$choices_obj = [];
$choices_obj[] = new Choice($discord, ['name' => 'asd5', 'value' => 'asd5']);
$choices_obj[] = new Choice($discord, ['name' => 'asd6', 'value' => 'asd6']);
return $choices_obj;
});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have command "price".
I have params "weapon", "skin", "condition", "stattrak".
I want to add multiple autocomplete to these fields: "weapon", "skin", "condition"
But my code is not working. I think because of sequence fields in listenCommand method.
Here is my code:
Beta Was this translation helpful? Give feedback.
All reactions