export declare 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.
Deprecated
Readonly
default_permission
:
boolean | undefined
Use setDefaultMemberPermissions or setDMPermission instead.
Deprecated
Readonly
dm_permission
:
boolean | undefined
Indicates whether the command is available in direct messages with the application.
Remarks
By default, commands are visible. This property is only for global commands.Readonly
Optional
name_localizations?
:
LocalizationMap
The name localizations of this command.
Readonly
name
:
string
The name of this command.
Readonly
The type of this command.
setDefaultMemberPermissions(permissions)
:
this
Sets the default permissions a member should have in order to run this command.
Remarks
You can set this to'0'
to disable the command by default.Name | Type | Optional | Description |
---|---|---|---|
permissions | Permissions_2 | bigint | number | null | undefined | No | The permissions bit field to set |
Deprecated
setDefaultPermission(value)
:
this
Use setDefaultMemberPermissions or setDMPermission instead.
Deprecated
Remarks
If set tofalse
, you will have to later PUT
the permissions for this command.Name | Type | Optional | Description |
---|---|---|---|
value | boolean | No | Whether to enable this command by default |
setDMPermission(enabled)
:
this
Sets if the command is available in direct messages with the application.
Remarks
By default, commands are visible. This method is only for global commands.Name | Type | Optional | Description |
---|---|---|---|
enabled | boolean | null | undefined | No | Whether the command should be enabled in direct messages |
setName(name)
:
this
Sets the name of this command.
Name | Type | Optional | Description |
---|---|---|---|
name | string | No | The name to use |
setNameLocalization(locale, localizedName)
:
this
Sets a name localization for this command.
Name | Type | Optional | Description |
---|---|---|---|
locale | LocaleString | No | The locale to set |
localizedName | string | null | No | The localized name for the given locale |
setNameLocalizations(localizedNames)
:
this
Sets the name localizations for this command.
Name | Type | Optional | Description |
---|---|---|---|
localizedNames | LocalizationMap | null | No | The object of localized names to set |
setType(type)
:
this
Sets the type of this command.
Name | Type | Optional | Description |
---|---|---|---|
type | ContextMenuCommandType | No | The type to use |
toJSON()
:
RESTPostAPIContextMenuApplicationCommandsJSONBody
Serializes this builder to API-compatible JSON data.