Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rocketchat

Rocket.Chat adapter processes incoming message stream, providing the their this modules as attributes for advanced branch callbacks to use. Provides member alias to some SDK methods, to support legacy Hubot scripts.

Hierarchy

Index

Constructors

constructor

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

Properties

api

api: "/Volumes/x/code/amazebot/bbot/node_modules/@rocket.chat/sdk/dist/lib/api" = sdk.api

bot

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

The current bBot instance

driver

driver: "/Volumes/x/code/amazebot/bbot/node_modules/@rocket.chat/sdk/dist/lib/driver" = sdk.driver

methodCache

methodCache: "/Volumes/x/code/amazebot/bbot/node_modules/@rocket.chat/sdk/dist/lib/methodCache" = sdk.methodCache

name

name: string = "rocketchat-message-adapter"

settings

settings: "/Volumes/x/code/amazebot/bbot/node_modules/@rocket.chat/sdk/dist/lib/settings" = sdk.settings

Methods

callMethod

  • callMethod(method: string, ...args: any[]): Promise<any>

dispatch

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

format

  • format(input: string): string
  • Parse any strings before sending to fix for Rocket.Chat syntaxes

    Parameters

    • input: string

    Returns string

getRoomId

  • getRoomId(room: string): Promise<string>

parseEnvelope

  • parseEnvelope(envelope: Envelope, roomId?: undefined | string): any[]
  • Parsing envelope content to an array of Rocket.Chat message schemas

    Parameters

    • envelope: Envelope
    • Optional roomId: undefined | string

    Returns 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

process

  • process(err: Error | null, message: any, meta: any): Promise<State>
  • Collect attributes to receive every incoming message in subscription

    Parameters

    • err: Error | null
    • message: any
    • meta: any

    Returns Promise<State>

shutdown

  • shutdown(): Promise<void>

start

  • start(): Promise<void>

Static getInstance

  • getInstance(bot: "/Volumes/x/code/amazebot/bbot/src/index"): Rocketchat

Generated using TypeDoc