Skip to main content

Namespace: PreconditionResolvers

Functions

parseConstructorPreConditionsCooldown

parseConstructorPreConditionsCooldown<P, O>(command, cooldownLimit, cooldownDelay, cooldownScope, cooldownFilteredUsers, preconditionContainerArray): void

Appends the Cooldown precondition when Command.Options.cooldownLimit and Command.Options.cooldownDelay are both non-zero.

Type parameters

NameType
PP
Oextends CommandOptions

Parameters

NameTypeDescription
commandCommand<P, O>The command to parse cooldowns for.
cooldownLimitundefined | numberThe cooldown limit to use.
cooldownDelayundefined | numberThe cooldown delay to use.
cooldownScopeundefined | BucketScopeThe cooldown scope to use.
cooldownFilteredUsersundefined | string[]The cooldown filtered users to use.
preconditionContainerArrayPreconditionContainerArrayThe precondition container array to append the precondition to.

Returns

void

Defined in

projects/framework/src/lib/precondition-resolvers/cooldown.ts:17


parseConstructorPreConditionsNsfw

parseConstructorPreConditionsNsfw(nsfw, preconditionContainerArray): void

Appends the NSFW precondition if SubcommandMappingMethod.nsfw is set to true.

Parameters

NameTypeDescription
nsfwundefined | booleanWhether this command is NSFW or not.
preconditionContainerArrayPreconditionContainerArrayThe precondition container array to append the precondition to.

Returns

void

Defined in

projects/framework/src/lib/precondition-resolvers/nsfw.ts:9


parseConstructorPreConditionsRequiredClientPermissions

parseConstructorPreConditionsRequiredClientPermissions(requiredClientPermissions, preconditionContainerArray): void

Appends the ClientPermissions precondition when Command.Options.requiredClientPermissions resolves to a non-zero bitfield.

Parameters

NameTypeDescription
requiredClientPermissionsundefined | PermissionResolvableThe required client permissions.
preconditionContainerArrayPreconditionContainerArrayThe precondition container array to append the precondition to.

Returns

void

Defined in

projects/framework/src/lib/precondition-resolvers/clientPermissions.ts:11


parseConstructorPreConditionsRequiredUserPermissions

parseConstructorPreConditionsRequiredUserPermissions(requiredUserPermissions, preconditionContainerArray): void

Appends the UserPermissions precondition when Command.Options.requiredUserPermissions resolves to a non-zero bitfield.

Parameters

NameTypeDescription
requiredUserPermissionsundefined | PermissionResolvableThe required user permissions.
preconditionContainerArrayPreconditionContainerArrayThe precondition container array to append the precondition to.

Returns

void

Defined in

projects/framework/src/lib/precondition-resolvers/userPermissions.ts:11


parseConstructorPreConditionsRunIn

parseConstructorPreConditionsRunIn(runIn, resolveConstructorPreConditionsRunType, preconditionContainerArray): void

Appends the RunIn precondition based on the values passed, defaulting to null, which doesn't add a precondition.

Parameters

NameTypeDescription
runInCommandRunInUnion | CommandSpecificRunInThe command's runIn option field from the constructor.
resolveConstructorPreConditionsRunType(types: CommandRunInUnion) => null | readonly ChannelType[]The function to resolve the run type from the constructor.
preconditionContainerArrayPreconditionContainerArrayThe precondition container array to append the precondition to.

Returns

void

Defined in

projects/framework/src/lib/precondition-resolvers/runIn.ts:15