Class: Discordrb::Events::AutocompleteEvent
- Inherits:
-
ApplicationCommandEvent
- Object
- Event
- InteractionCreateEvent
- ApplicationCommandEvent
- Discordrb::Events::AutocompleteEvent
- Defined in:
- lib/discordrb/events/interactions.rb
Overview
An event for an autocomplete option choice.
Instance Attribute Summary collapse
-
#choices ⇒ Hash
readonly
An empty hash that can be used to return choices by adding K/V pairs.
-
#focused ⇒ String
readonly
Name of the currently focused option.
Attributes inherited from ApplicationCommandEvent
#command_id, #command_name, #options, #resolved, #subcommand, #subcommand_group, #target_id
Attributes inherited from InteractionCreateEvent
#channel, #channel_id, #interaction, #server, #server_id, #type, #user
Attributes inherited from Event
Instance Method Summary collapse
-
#respond(choices:) ⇒ Object
Respond to this interaction with autocomplete choices.
Methods inherited from ApplicationCommandEvent
Methods inherited from InteractionCreateEvent
#defer, #defer_update, #delete_message, #delete_response, #edit_message, #edit_response, #get_component, #send_message, #show_modal, #update_message
Instance Attribute Details
#choices ⇒ Hash (readonly)
Returns An empty hash that can be used to return choices by adding K/V pairs.
508 509 510 |
# File 'lib/discordrb/events/interactions.rb', line 508 def choices @choices end |
#focused ⇒ String (readonly)
Returns Name of the currently focused option.
505 506 507 |
# File 'lib/discordrb/events/interactions.rb', line 505 def focused @focused end |
Instance Method Details
#respond(choices:) ⇒ Object
Respond to this interaction with autocomplete choices.
532 533 534 |
# File 'lib/discordrb/events/interactions.rb', line 532 def respond(choices:) @interaction.show_autocomplete_choices(choices || []) end |