CommandPermission
Implementation of the Application Command Permission Structure as a Luau builder.
Summary
Properties
CommandPermission.id :: string?CommandPermission.type :: CommandPermissionType?CommandPermission.permission :: booleanProperties
Section titled “Properties”The ID of the role, user, or channel this permission applies to.
Whether this permission targets a role, user, or channel.
permission
Section titled “permission”Whether the target is allowed (true) or denied (false) access to the command.
Methods
Section titled “Methods”CommandPermission : setId ( id ) -> CommandPermission
Sets the ID of the role, user, or channel this permission applies to.
Parameters
| id: Snowflake |
Returns
| CommandPermission |
setType
Section titled “setType”CommandPermission : setType ( permissionType ) -> CommandPermission
Sets the type of entity this permission targets.
Parameters
| permissionType: CommandPermissionType |
Returns
| CommandPermission |
CommandPermission : allow ( ) -> CommandPermission
Allows the targeted role, user, or channel to use the command.
Returns
| CommandPermission |
CommandPermission : deny ( ) -> CommandPermission
Denies the targeted role, user, or channel from using the command.
Returns
| CommandPermission |
CommandPermission : build ( ) -> JSON
Responsible for building the GuildApplicationCommandPermissionObject JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”CommandPermission . new ( resource ) -> CommandPermission
Responsible for creating a new CommandPermission.
Parameters
| resource: { id: apiTypes.Snowflake?, permissionType: CommandPermissionType?, permission: boolean?, } |
Returns
| CommandPermission |