class Discordrb::Components::TextInput

Text input component for use in modals. Can be either a line (‘short`), or a multi line (`paragraph`) block.

Constants

PARAGRAPH

Multi-line text input

SHORT

Single line text input

Attributes

custom_id[R]

@return [String]

label[R]

@return [String]

max_length[R]

@return [Integer, nil]

min_length[R]

@return [Integer, nil]

placeholder[R]

@return [String, nil]

required[R]

@return [true, false]

style[R]

@return [Symbol]

value[R]

@return [String, nil]

Public Class Methods

new(data, bot) click to toggle source

@!visibility private

# File lib/discordrb/data/component.rb, line 204
def initialize(data, bot)
  @bot = bot
  @style = data['style'] == SHORT ? :short : :paragraph
  @label = data['label']
  @min_length = data['min_length']
  @max_length = data['max_length']
  @required = data['required']
  @value = data['value']
  @placeholder = data['placeholder']
  @custom_id = data['custom_id']
end

Public Instance Methods

paragraph?() click to toggle source
# File lib/discordrb/data/component.rb, line 220
def paragraph?
  @style == :paragraph
end
required?() click to toggle source
# File lib/discordrb/data/component.rb, line 224
def required?
  @required
end
short?() click to toggle source
# File lib/discordrb/data/component.rb, line 216
def short?
  @style == :short
end