Skip to main content

Class: UserPermissionsPrecondition

Constructs a contextful permissions precondition requirement.

Since

1.0.0

Example

export class CoreCommand extends Command {
public constructor(context: Command.Context) {
super(context, {
preconditions: [
'GuildOnly',
new UserPermissionsPrecondition('ADD_REACTIONS')
]
});
}

public messageRun(message: Message, args: Args) {
// ...
}
}

Implements

Constructors

new UserPermissionsPrecondition()

new UserPermissionsPrecondition(permissions: PermissionResolvable): UserPermissionsPrecondition

Constructs a precondition container entry.

Parameters

ParameterTypeDescription
permissionsPermissionResolvableThe permissions that will be required by this command.

Returns

UserPermissionsPrecondition

Source

projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:33

Properties

context

context: object

The context to be set at PreconditionContainerSingle.context.

Since

1.0.0

permissions

permissions: PermissionsBitField

Implementation of

PreconditionSingleResolvableDetails . context

Source

projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:27


name

name: "UserPermissions"

The name of the precondition to retrieve from SapphireClient.preconditions.

Since

1.0.0

Implementation of

PreconditionSingleResolvableDetails . name

Source

projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:26