Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Adapter

Base Adapter class, extending to create different types of adapters.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Adapter(bot: "/Volumes/x/code/amazebot/bbot/src/index"): Adapter
  • 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 Adapter

Properties

bot

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

The current bBot instance

name

name: string = "base-adapter"

Name of adapter, used for logs

Methods

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