Options
All
  • Public
  • Public/Protected
  • All
Menu

Module events

Events is the base communication channel of the bot. Messages and payloads are a part of it, and it is the only way to receive or send informations. Each event goes through the whole middleware chain (incoming or outgoing) before being received by either the bot or the user.

Index

Functions

registerMiddleware

  • Register a new middleware globally. They are sorted based on their declared order each time a new one is registered.

    Parameters

    Returns void

removeMiddleware

  • removeMiddleware(middlewareName: any): void
  • Removes the specified middleware from the chain. This is mostly used in case of a module being reloaded

    Parameters

    • middlewareName: any

    Returns void

replyToEvent

  • Reply easily to any received event. It accepts an array of payloads and will send a complete event with each payloads. It is often paired with cms.renderElement to generate payload for a specific content type

    Parameters

    • eventDestination: EventDestination

      The destination to identify the target

    • payloads: any[]

      One or multiple payloads to send

    Returns void

sendEvent

  • sendEvent(event: Event): void
  • Send an event through the incoming or outgoing middleware chain

    Parameters

    • event: Event

      The event to send

    Returns void

Generated using TypeDoc