Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Const Event

Event: EventDestination & object

A BotpressEvent is how conversational channels interact with Botpress. Events represent all the interactions that make up a conversation. That means the different message types (text, image, buttons, carousels etc) but also the navigational events (chat open, user typing) and contextual events (user returned home, order delivered).

EventDirection

EventDirection: "incoming" | "outgoing"

MiddlewareDefinition

MiddlewareDefinition: object

The Middleware Definition is used by the event engine to register a middleware in the chain. The order in which they are executed is important, since some may require previous processing, while others can swallow the events. Incoming chain is executed when the bot receives an event. Outgoing chain is executed when an event is sent to a user

Type declaration

  • description: string
  • direction: EventDirection

    Indicates if this middleware should act on incoming or outgoing events

  • handler: MiddlewareHandler

    A method with two parameters (event and a callback) used to handle the event

  • name: string

    The internal name used to identify the middleware in configuration files

  • order: number

    The position in which this middleware should intercept messages in the middleware chain.

MiddlewareHandler

MiddlewareHandler: function

The actual middleware function that gets executed. It receives an event and expects to call next() Not calling next() will result in a middleware timeout and will stop processing If you intentionally want to stop processing, call next(null, false)

Type declaration

MiddlewareNextCallback

MiddlewareNextCallback: function

Call next with an error as first argument to throw an error Call next with true as second argument to swallow the event (i.e. stop the processing chain) Call next with no parameters or false as second argument to continue processing to next middleware

Type declaration

    • (error?: Error, swallow?: undefined | false | true): void
    • Parameters

      • Optional error: Error
      • Optional swallow: undefined | false | true

      Returns void

Generated using TypeDoc