This PR adds a better syntax and the possibility to handle autocomplete within Slash Commands
It provides 3 ways of syntax
Using a choice class
public function autocomplete(): array
{
return [
'attribute' => fn ($interaction, $value) => [
Choice::new($this->discord(), 'attribute', 'attribute'),
],
];
}
Using key value pairs
public function autocomplete(): array
{
return [
'attribute' => fn ($interaction, $value) => [
'attribute' => 'attribute',
],
];
}
Using just an array of strings, with this option the autocomplete handler takes the liberty of using the string to create a name for the choice slugified, this last option might be too opinionated but let me know your thoughts.
public function autocomplete(): array
{
return [
'attribute' => fn ($interaction, $value) => [
'attribute',
],
];
}
This PR adds a better syntax and the possibility to handle autocomplete within Slash Commands It provides 3 ways of syntax
Using a choice class
Using key value pairs
Using just an array of strings, with this option the autocomplete handler takes the liberty of using the string to create a name for the choice slugified, this last option might be too opinionated but let me know your thoughts.