Class: UserPermissionsPrecondition
Defined in: projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:25
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
PreconditionSingleResolvableDetails
<"UserPermissions"
>
Constructors
new UserPermissionsPrecondition()
new UserPermissionsPrecondition(
permissions
:PermissionResolvable
):UserPermissionsPrecondition
Defined in: projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:33
Constructs a precondition container entry.
Parameters
Parameter | Type | Description |
---|---|---|
permissions | PermissionResolvable | The permissions that will be required by this command. |
Returns
Properties
context
context:
object
Defined in: projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:27
The context to be set at PreconditionContainerSingle.context.
permissions
permissions:
PermissionsBitField
Since
1.0.0
Implementation of
PreconditionSingleResolvableDetails
.context
name
name:
"UserPermissions"
Defined in: projects/framework/src/lib/utils/preconditions/containers/UserPermissionsPrecondition.ts:26
The name of the precondition to retrieve from SapphireClient.preconditions.
Since
1.0.0