class ContextMenuCommandBuilder

export declare class ContextMenuCommandBuilder

A builder that creates API-compatible JSON data for context menu commands.

readonly
default_member_permissions : Permissions_2 | null | undefined

The set of permissions represented as a bit set for the command.

deprecatedreadonly
default_permission : boolean | undefined

Whether this command is enabled by default when the application is added to a guild.

readonly
dm_permission : boolean | undefined

Indicates whether the command is available in direct messages with the application.

readonlyoptional
name_localizations? : LocalizationMap

The name localizations of this command.

readonly
name : string

The name of this command.

readonly
type : ContextMenuCommandType

The type of this command.

setDefaultMemberPermissions(
permissions: Permissions_2 | bigint | number | null | undefined
) : this

Sets the default permissions a member should have in order to run this command.

See also: https://discord.com/developers/docs/interactions/application-commands#permissionsundefined

deprecated
setDefaultPermission(
value: boolean
) : this

Sets whether the command is enabled by default when the application is added to a guild.

See also: https://discord.com/developers/docs/interactions/application-commands#permissionsundefined

setDMPermission(
enabled: boolean | null | undefined
) : this

Sets if the command is available in direct messages with the application.

See also: https://discord.com/developers/docs/interactions/application-commands#permissionsundefined

setName(
name: string
) : this

Sets the name of this command.

setNameLocalization(
locale: LocaleString
localizedName: string | null
) : this

Sets a name localization for this command.

setNameLocalizations(
localizedNames: LocalizationMap | null
) : this

Sets the name localizations for this command.

setType() : this

Sets the type of this command.

Serializes this builder to API-compatible JSON data.