DiscordLua
discorddiscord
v1.2.4
Install

TextInputBuilder

Builder
On this page

TextInputBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.

builder Module 1.2.4 Source

Constructor

TextInputBuilder.new()

The class table is callable, so TextInputBuilder() is the same as .new.

No parameters.

lua
local discord = require("discord")
local object = discord.TextInputBuilder()

Properties

TextInputBuilder.data

# readonly
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

TextInputBuilder.from()

# static

Performs from on this TextInputBuilder. Call it from bot code when you need that operation on the current object.

Signature

TextInputBuilder.from(data)

Parameters

NameTypeRequiredBehavior
data any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
id string required Snowflake id string.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
label any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
value any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
value any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
text any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
required any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
style any optional Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
value any required Passed through to the implementation as written.

Returns

TextInputBuilder — the same instance, for chaining.

Example

lua
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

lua
local discord = require("discord")
-- object is a TextInputBuilder
object:toJSON()

Examples

lua
local discord = require("discord")
local object = discord.TextInputBuilder({})

ActionRowBuilder · AttachmentBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ContainerBuilder · ContextMenuCommandBuilder · EmbedBuilder

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc