Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Path

Path contains collections of branches and methods to create each type.

Hierarchy

  • Path

Implements

Index

Constructors

constructor

Properties

act

act: object

Type declaration

listen

listen: object

Type declaration

scope

scope: string

understand

understand: object

Type declaration

Methods

NLU

  • NLU(criteria: bot.NaturalLanguageCriteria, action: IBranchCallback | string, options?: bot.IBranch): string
  • Create a natural language branch to match on NLU result attributes.

    Parameters

    • criteria: bot.NaturalLanguageCriteria
    • action: IBranchCallback | string
    • Optional options: bot.IBranch

    Returns string

add

  • add(branch: Branch, collection: "listen" | "understand" | "act"): string
  • Add branch to collection, for separation based on thought processes.

    Parameters

    • branch: Branch
    • collection: "listen" | "understand" | "act"

    Returns string

catchAll

  • catchAll(action: IBranchCallback | string, options?: bot.IBranch): string
  • Create a branch that triggers when no other branch matches.

    Parameters

    Returns string

custom

  • Create custom branch with provided matcher, action and optional meta.

    Parameters

    Returns string

customNLU

direct

  • direct(condition: string | RegExp | bot.Condition | bot.Condition[] | bot.ConditionCollection | Conditions, action: IBranchCallback | string, options?: bot.IBranch): string
  • Create text branch pre-matched on the bot name as prefix.

    Parameters

    • condition: string | RegExp | bot.Condition | bot.Condition[] | bot.ConditionCollection | Conditions
    • action: IBranchCallback | string
    • Optional options: bot.IBranch

    Returns string

directNLU

  • directNLU(criteria: bot.NaturalLanguageCriteria, action: IBranchCallback | string, options?: bot.IBranch): string
  • Create a natural language branch pre-matched on the bot name as prefix.

    Parameters

    • criteria: bot.NaturalLanguageCriteria
    • action: IBranchCallback | string
    • Optional options: bot.IBranch

    Returns string

enter

  • Create a branch that triggers when user enters a room.

    Parameters

    Returns string

forced

  • forced(collection: "listen" | "understand" | "act"): number
  • Remove all but forced branches from collection, return remaining size.

    Parameters

    • collection: "listen" | "understand" | "act"

    Returns number

leave

  • Create a branch that triggers when user leaves a room.

    Parameters

    Returns string

reset

  • reset(): void
  • Reset path to initial empty branch collections

    Returns void

text

  • text(condition: string | RegExp | bot.Condition | bot.Condition[] | bot.ConditionCollection | Conditions, action: IBranchCallback | string, options?: bot.IBranch): string
  • Create text branch with provided regex, action and options

    Parameters

    • condition: string | RegExp | bot.Condition | bot.Condition[] | bot.ConditionCollection | Conditions
    • action: IBranchCallback | string
    • Optional options: bot.IBranch

    Returns string

topic

  • Create a branch that triggers when user changes the topic.

    Parameters

    Returns string

Generated using TypeDoc