Skip to content
GitHub

DispatchResult

interface in meocord/interface Since 4.1.0

interface DispatchResult

What a DispatchObserver is told about a call once it has settled.

Members

outcome

outcome: DispatchOutcome

How the call ended.

startedAt

startedAt: number

When dispatch received the call, in milliseconds since the Unix epoch.

durationMs

durationMs: number

How long the call took, in milliseconds from performance.now(): from dispatch until the filters and the fallback had answered, so it includes an error's answer.

deniedBy

deniedBy?: abstract new (...args: any[]) => unknown

The guard class that denied the call, whether it returned false or threw GuardDeniedError. Only with the outcome 'denied', and not for a GuardDeniedError the handler threw itself.

response

response?: 'replied' | 'deferred' | 'unanswered'

Where the interaction's answer stood once the call settled: 'replied', 'deferred' (deferred and never followed up, which leaves the user waiting) or 'unanswered'. An autocomplete is 'replied' once it answered. Only for interactions; undefined for messages, reactions and events.

error

error?: unknown

The error the call ended with, for 'denied' by GuardDeniedError, 'cooldown', 'invalid', 'refused', 'error' and most 'not-found'.

handled

handled: boolean

Whether an exception filter or the built-in fallback answered the error. false without an error.

See also