Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MessageAdapter

Message Adapter class, extended to connect bBot with messaging platform.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new MessageAdapter(bot: "/Volumes/x/code/amazebot/bbot/src/index"): MessageAdapter
  • Create an adapter instance. Adapter modules should provide a .use method that accepts the bot, to provide to their adapter class constructor, returning the instance.

    Parameters

    • bot: "/Volumes/x/code/amazebot/bbot/src/index"

      The current bBot instance

    Returns MessageAdapter

Properties

bot

bot: "/Volumes/x/code/amazebot/bbot/src/index"

The current bBot instance

name

name: string = "message-adapter"

Methods

Abstract dispatch

  • dispatch(envelope: Envelope): Promise<any>

parseSchema

  • parseSchema(internal: any, schema: object, external?: any): any
  • Utility to convert internal object to schema required in adapter platform. Passing the original internal object as the external, allows inheriting all attributes without needing to map the ones that are the same in both. Otherwise, result would only include values from defined schema fields.

    Parameters

    • internal: any
    • schema: object
      • [path: string]: string
    • Default value external: any = {}

    Returns any

Abstract shutdown

  • shutdown(): Promise<void>

Abstract start

  • start(): Promise<void>

Generated using TypeDoc