Class: Discordrb::Components::TextInput

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data/component.rb

Overview

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

Constant Summary collapse

SHORT =

Single line text input

1
PARAGRAPH =

Multi-line text input

2

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#custom_idString (readonly)

Returns:



180
181
182
# File 'lib/discordrb/data/component.rb', line 180

def custom_id
  @custom_id
end

#labelString (readonly)

Returns:



186
187
188
# File 'lib/discordrb/data/component.rb', line 186

def label
  @label
end

#max_lengthInteger? (readonly)

Returns:



192
193
194
# File 'lib/discordrb/data/component.rb', line 192

def max_length
  @max_length
end

#min_lengthInteger? (readonly)

Returns:



189
190
191
# File 'lib/discordrb/data/component.rb', line 189

def min_length
  @min_length
end

#placeholderString? (readonly)

Returns:



201
202
203
# File 'lib/discordrb/data/component.rb', line 201

def placeholder
  @placeholder
end

#requiredtrue, false (readonly)

Returns:

  • (true, false)


195
196
197
# File 'lib/discordrb/data/component.rb', line 195

def required
  @required
end

#styleSymbol (readonly)

Returns:

  • (Symbol)


183
184
185
# File 'lib/discordrb/data/component.rb', line 183

def style
  @style
end

#valueString? (readonly)

Returns:



198
199
200
# File 'lib/discordrb/data/component.rb', line 198

def value
  @value
end

Instance Method Details

#paragraph?Boolean

Returns:

  • (Boolean)


220
221
222
# File 'lib/discordrb/data/component.rb', line 220

def paragraph?
  @style == :paragraph
end

#required?Boolean

Returns:

  • (Boolean)


224
225
226
# File 'lib/discordrb/data/component.rb', line 224

def required?
  @required
end

#short?Boolean

Returns:

  • (Boolean)


216
217
218
# File 'lib/discordrb/data/component.rb', line 216

def short?
  @style == :short
end