MediaGalleryItemBuilder
BuilderOn this page
MediaGalleryItemBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.
Constructor
MediaGalleryItemBuilder.new(data) The class table is callable, so MediaGalleryItemBuilder(data) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
data |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.MediaGalleryItemBuilder({})Properties
- Name
data- Type
any- Access
- readonly
- Description
- Instance field
MediaGalleryItemBuilder.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 MediaGalleryItemBuilder.
Methods
MediaGalleryItemBuilder:clearDescription()
#Performs clear description on this MediaGalleryItemBuilder. Call it from bot code when you need that operation on the current object.
Signature
MediaGalleryItemBuilder:clearDescription() Parameters
No parameters.
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
object:clearDescription()Performs from on this MediaGalleryItemBuilder. Call it from bot code when you need that operation on the current object.
Signature
MediaGalleryItemBuilder.from(data) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
data |
any |
required | Passed through to the implementation as written. |
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
MediaGalleryItemBuilder.from(data)MediaGalleryItemBuilder:setDescription()
#Set the Description field. Builders return this MediaGalleryItemBuilder so setters can be chained.
Signature
MediaGalleryItemBuilder:setDescription(description) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
description |
any |
required | Passed through to the implementation as written. |
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
object:setDescription(description)MediaGalleryItemBuilder:setSpoiler()
#Set the Spoiler field. Builders return this MediaGalleryItemBuilder so setters can be chained.
Signature
MediaGalleryItemBuilder:setSpoiler(spoiler) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
spoiler |
any |
required | Passed through to the implementation as written. |
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
object:setSpoiler(spoiler)MediaGalleryItemBuilder:setURL()
#Set the URL field. Builders return this MediaGalleryItemBuilder so setters can be chained.
Signature
MediaGalleryItemBuilder:setURL(url) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
url |
any |
required | Passed through to the implementation as written. |
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
object:setURL(url)MediaGalleryItemBuilder:toJSON()
#Serialize this MediaGalleryItemBuilder into a Lua table suitable for REST or debugging.
Signature
MediaGalleryItemBuilder:toJSON() Parameters
No parameters.
Returns
MediaGalleryItemBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a MediaGalleryItemBuilder
object:toJSON()Examples
local discord = require("discord")
local object = discord.MediaGalleryItemBuilder({})Related APIs
ActionRowBuilder · AttachmentBuilder · BaseSelectMenuBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ComponentBuilder · ContainerBuilder
Version: discord 1.2.9 · runtime 1.0.0