Class: Discordrb::Webhooks::View::SelectMenuBuilder
- Inherits:
-
Object
- Object
- Discordrb::Webhooks::View::SelectMenuBuilder
- Defined in:
- lib/discordrb/webhooks/view.rb
Overview
A builder to assist in adding options to select menus.
Instance Method Summary collapse
-
#option(label:, value:, description: nil, emoji: nil, default: nil) ⇒ Object
Add an option to this select menu.
Instance Method Details
#option(label:, value:, description: nil, emoji: nil, default: nil) ⇒ Object
Add an option to this select menu.
186 187 188 189 190 191 192 193 194 195 |
# File 'lib/discordrb/webhooks/view.rb', line 186 def option(label:, value:, description: nil, emoji: nil, default: nil) emoji = case emoji when Integer, String emoji.to_i.positive? ? { id: emoji } : { name: emoji } else emoji&.to_h end @options << { label: label, value: value, description: description, emoji: emoji, default: default } end |