TextInputBuilder
BuilderOn this page
TextInputBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.
Constructor
TextInputBuilder.new() The class table is callable, so TextInputBuilder() is the same as .new.
No parameters.
local discord = require("discord")
local object = discord.TextInputBuilder()Properties
- Name
data- Type
any- Access
- readonly
- Description
- Instance field
TextInputBuilder.data. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this TextInputBuilder.
Methods
Performs from on this TextInputBuilder. Call it from bot code when you need that operation on the current object.
Signature
TextInputBuilder.from(data) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
data |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
TextInputBuilder.from(data)TextInputBuilder:setCustomId()
#Set the CustomId field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setCustomId(id) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setCustomId("123")TextInputBuilder:setLabel()
#Set the Label field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setLabel(label) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
label |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setLabel(label)TextInputBuilder:setMaxLength()
#Set the MaxLength field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setMaxLength(value) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setMaxLength(value)TextInputBuilder:setMinLength()
#Set the MinLength field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setMinLength(value) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setMinLength(value)TextInputBuilder:setPlaceholder()
#Set the Placeholder field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setPlaceholder(text) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
text |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setPlaceholder(text)TextInputBuilder:setRequired()
#Set the Required field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setRequired(required) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
required |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setRequired(required)TextInputBuilder:setStyle()
#Set the Style field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setStyle(style) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
style |
any |
optional | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setStyle(style)TextInputBuilder:setValue()
#Set the Value field. Builders return this TextInputBuilder so setters can be chained.
Signature
TextInputBuilder:setValue(value) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:setValue(value)TextInputBuilder:toJSON()
#Serialize this TextInputBuilder into a Lua table suitable for REST or debugging.
Signature
TextInputBuilder:toJSON() Parameters
No parameters.
Returns
TextInputBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a TextInputBuilder
object:toJSON()Examples
local discord = require("discord")
local object = discord.TextInputBuilder({})Related APIs
ActionRowBuilder · AttachmentBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ContainerBuilder · ContextMenuCommandBuilder · EmbedBuilder
Version: discord 1.2.4 · runtime 1.0.0