Class: ClientPermissionsPrecondition
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 ClientPermissionsPrecondition('ADD_REACTIONS')
]
});
}
public messageRun(message: Message, args: Args) {
// ...
}
}
Implements
PreconditionSingleResolvableDetails
<"ClientPermissions"
>
Constructors
new ClientPermissionsPrecondition()
new ClientPermissionsPrecondition(
permissions
:PermissionResolvable
):ClientPermissionsPrecondition
Constructs a precondition container entry.
Parameters
Parameter | Type | Description |
---|---|---|
permissions | PermissionResolvable | The permissions that will be required by this command. |
Returns
Defined in
projects/framework/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts:33
Properties
context
context:
object
The context to be set at PreconditionContainerSingle.context.
permissions
permissions:
PermissionsBitField
Since
1.0.0
Implementation of
PreconditionSingleResolvableDetails
.context
Defined in
projects/framework/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts:27
name
name:
"ClientPermissions"
The name of the precondition to retrieve from SapphireClient.preconditions.
Since
1.0.0
Implementation of
PreconditionSingleResolvableDetails
.name
Defined in
projects/framework/src/lib/utils/preconditions/containers/ClientPermissionsPrecondition.ts:26