Closed Log1x closed 5 months ago
This adds native select support the Laracord's message class. Very easy to use.
$this ->message('Pick a fruit!') ->select([ 'Apples' => 'apples', 'Oranges' => 'oranges', 'Bananas' => 'bananas', ], route: 'selectFruit', placeholder: 'Select a fruit...') ->send($message);
Getting selected values can be done through $interaction->data->values – an example using an interaction route:
$interaction->data->values
public function interactions(): array { return [ 'selectFruit' => fn (Interaction $interaction) => $interaction->acknowledge() && dump($interaction->data->values), ]; }
You can also easily create select menus for users, roles, channels, etc.
$this ->message('Pick a select, any select!') ->select(type: 'channel', route: 'handleChannel') ->select(type: 'mentionable', route: 'handleMentionable') ->select(type: 'role', route: 'handleRole') ->select(type: 'user', route: 'handleUser') ->send($message);
Documentation: https://laracord.com/docs/messages#content-select-menus
This adds native select support the Laracord's message class. Very easy to use.
Getting selected values can be done through
$interaction->data->values
– an example using an interaction route:You can also easily create select menus for users, roles, channels, etc.
Documentation: https://laracord.com/docs/messages#content-select-menus