Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextDirectBranch

Text Direct Branch pre-matches the text for bot name prefix. If matched on the direct pattern (name prefix) it runs the branch matcher on a clone of the message with the prefix removed, this allows conditions like is to operate on the body of the message, without failing due to a prefix.

Hierarchy

Indexable

[key: string]: any

Text Direct Branch pre-matches the text for bot name prefix. If matched on the direct pattern (name prefix) it runs the branch matcher on a clone of the message with the prefix removed, this allows conditions like is to operate on the body of the message, without failing due to a prefix.

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

callback

callback: IBranchCallback

conditions

conditions: Conditions

force

force: boolean = false

id

id: string

Optional match

match: any

Optional matched

matched: undefined | true | false

Methods

matcher

process

  • Runs the matcher, then middleware and callback if matched. Middleware can intercept and prevent the callback from executing. If the state has already matched on prior branch, it will not match again unless forced to, with the branch's force property.

    Parameters

    • b: State

      State containing message to process

    • middleware: Middleware

      Executes before the branch callback if matched

    • Default value done: IBranchDone = () => null

      Called after middleware (optional), with match status

    Returns Promise<State>

Generated using TypeDoc