CooldownStoreError
class in meocord/common Since 4.1.0
class CooldownStoreError extends ErrorThrown when the cooldown store fails and @MeoCord({ cooldownStoreFailure }) is 'deny', its default.
Catch it in a filter to word the refusal your own way, or in the user's language. Without one, the built-in fallback
answers only the caller, with cooldownStoreMessage. A message command is not answered, unless
messages.dmOnError tells its author in a direct message, once per outage.
Examples
@Catch(CooldownStoreError)
export class CooldownStoreFilter implements ExceptionFilter<CooldownStoreError> {
async catch(error: CooldownStoreError, context: ExecutionContext) {
await context.response?.error(error, { message: 'Hold on a moment and try again.', visibility: 'private' })
}
}Members
constructor
new CooldownStoreError(cause: unknown, timedOut: boolean)Parameters
| Name | Type | Description |
|---|---|---|
cause | unknown | What the store threw or rejected with; undefined when it did not answer in time. |
timedOut | boolean | Whether the store did not answer within |
timedOut
readonly timedOut: boolean