ContextMenuCommandBuilder
BuilderOn this page
ContextMenuCommandBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.
Constructor
ContextMenuCommandBuilder.new(commandType) The class table is callable, so ContextMenuCommandBuilder(commandType) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
commandType |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.ContextMenuCommandBuilder({})Properties
- 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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
permissions |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
localizations |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
nsfw |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
commandType |
any |
required | Passed through to the implementation as written. |
Returns
ContextMenuCommandBuilder — the same instance, for chaining.
Example
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
local discord = require("discord")
-- object is a ContextMenuCommandBuilder
object:toJSON()Examples
local discord = require("discord")
local object = discord.ContextMenuCommandBuilder({})Related APIs
ActionRowBuilder · AttachmentBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ContainerBuilder · EmbedBuilder · FileBuilder
Version: discord 1.2.4 · runtime 1.0.0