Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsoleConnector

Connects a UniversalBot to the command line via a console window.

Hierarchy

  • ConsoleConnector

Implements

Index

Methods

listen

onEvent

  • onEvent(handler: function): void
  • Called by the UniversalBot at registration time to register a handler for receiving incoming events from a channel.

    Parameters

    • handler: function
        • (events: IEvent[], callback?: function): void
        • Parameters

          • events: IEvent[]
          • Optional callback: function
              • (err: Error): void
              • Parameters

                • err: Error

                Returns void

          Returns void

    Returns void

onInvoke

  • onInvoke(handler: function): void
  • Used to register a handler for receiving incoming invoke events.

    Parameters

    • handler: function
        • (event: IEvent, cb?: function): void
        • Parameters

          • event: IEvent
          • Optional cb: function
              • (err: Error, body: any, status?: number): void
              • Parameters

                • err: Error
                • body: any
                • Optional status: number

                Returns void

          Returns void

    Returns void

processMessage

send

  • send(messages: IMessage[], callback: function): void
  • Called by the UniversalBot to deliver outgoing messages to a user.

    Parameters

    • messages: IMessage[]
    • callback: function
        • (err: Error, addresses?: IAddress[]): void
        • Parameters

          • err: Error
          • Optional addresses: IAddress[]

          Returns void

    Returns void

startConversation

  • startConversation(address: IAddress, callback: function): void
  • Called when a UniversalBot wants to start a new proactive conversation with a user. The connector should return a properly formated address object with a populated conversation field.

    Parameters

    • address: IAddress
    • callback: function
        • (err: Error, address?: IAddress): void
        • Parameters

          Returns void

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method