Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Shell

Load prompts and render chat in shell, for testing interactions

Hierarchy

Index

Constructors

constructor

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

Properties

bot

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

The current bBot instance

debug

debug: boolean = false

line

line: Separator = new inquirer.Separator()

logs

logs: string[] = ['']

messages

messages: [string, string][] = []

name

name: string = "shell-message-adapter"

Optional room

room: undefined | object

Optional transport

transport: Transport

ui

ui: any

Optional user

user: User

Methods

dispatch

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

log

  • log(logEvent: any, callback: any): void
  • Write log events to the inquirer UI

    Parameters

    • logEvent: any
    • callback: any

    Returns void

logSetup

  • logSetup(): void

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

prompt

  • prompt(): Promise<void>
  • Prompt for message input, recursive after each render

    Returns Promise<void>

render

  • render(): Promise<void>
  • Update chat window and return to input prompt

    Returns Promise<void>

roomSetup

  • roomSetup(): Promise<void>
  • Write prompt to collect room and user name, or take from env settings

    Returns Promise<void>

shutdown

  • shutdown(): Promise<void>

start

  • start(): Promise<void>

Static getInstance

  • getInstance(bot: "/Volumes/x/code/amazebot/bbot/src/index"): Shell
  • Singleton instance init

    Parameters

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

    Returns Shell

Generated using TypeDoc