Skip to content
GitHub

DispatchOutcome

type alias in meocord/interface Since 4.1.0

type DispatchOutcome =
  'ran' | 'denied' | 'cooldown' | 'invalid' | 'refused' | 'error' | 'not-found'

How a dispatched call ended, as a DispatchObserver is told.

  • 'ran': it settled without an error. An interceptor that answers without calling next.handle(), from a cache for instance, counts too.
  • 'denied': a guard returned false or threw GuardDeniedError.
  • 'cooldown': a @Cooldown refused it with CooldownError.
  • 'invalid': the user's input doesn't fit: @Validate refused it with ValidationError, or a message named a command it doesn't fit, a MessageUsageError: a word of the wrong type, a param left out, a flag the command lacks, a command sent where it doesn't work, or a parent's words alone.
  • 'refused': a UserError told the user what to fix, such as too few coins: their mistake, not a fault of the bot.
  • 'error': anything else was thrown, by the handler, a pipe, an interceptor or a guard.
  • 'not-found': an interaction no handler matches and nothing else answers, such as a button whose customId no pattern routes, or an autocomplete no @Autocomplete claims.

See also