DiscordLua
discorddiscord
v1.2.4
Install

ContextMenuCommandBuilder

Builder
On this page

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

builder Module 1.2.4 Source

Constructor

ContextMenuCommandBuilder.new(commandType)

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

NameTypeRequiredBehavior
commandType any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.ContextMenuCommandBuilder({})

Properties

ContextMenuCommandBuilder.data

# readonly
Name
data
Type
any
Access
readonly
Description
Instance field ContextMenuCommandBuilder.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 ContextMenuCommandBuilder.

Methods

ContextMenuCommandBuilder:setContexts()

#

Set the Contexts field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setContexts(first, ...)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setContexts(first, ...)

ContextMenuCommandBuilder:setDefaultMemberPermissions()

#

Set the DefaultMemberPermissions field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setDefaultMemberPermissions(permissions)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setDefaultMemberPermissions(permissions)

ContextMenuCommandBuilder:setDMPermission()

#

Set the DMPermission field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setDMPermission(enabled)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setDMPermission(enabled)

ContextMenuCommandBuilder:setIntegrationTypes()

#

Set the IntegrationTypes field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setIntegrationTypes(first, ...)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setIntegrationTypes(first, ...)

ContextMenuCommandBuilder:setName()

#

Set the Name field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setName(name)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setName(name)

ContextMenuCommandBuilder:setNameLocalizations()

#

Set the NameLocalizations field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setNameLocalizations(localizations)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setNameLocalizations(localizations)

ContextMenuCommandBuilder:setNSFW()

#

Set the NSFW field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setNSFW(nsfw)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setNSFW(nsfw)

ContextMenuCommandBuilder:setType()

#

Set the Type field. Builders return this ContextMenuCommandBuilder so setters can be chained.

Signature

ContextMenuCommandBuilder:setType(commandType)

Parameters

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

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:setType(commandType)

ContextMenuCommandBuilder:toJSON()

#

Serialize this ContextMenuCommandBuilder into a Lua table suitable for REST or debugging.

Signature

ContextMenuCommandBuilder:toJSON()

Parameters

No parameters.

Returns

ContextMenuCommandBuilder — the same instance, for chaining.

Example

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

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc