LogoPixi’VN
indexNamespacesHashtagCommandsFunctions

Function: run()

> run(tag, step, props): Promise<PixiVNJsonOperation | undefined>

Defined in: src/handlers/hashtag-commands.ts:173

This function run the Hashtag-Command, it will be called before running the step. It will interpret the Hashtag-Command and return the corresponding operation to run before the step. If the Hashtag-Command is not valid, it will return undefined and the system will run the step normally.

Parameters

tag

string

The Hashtag-Command to interpret, it is the string that starts with # and is followed by the operation type and its parameters.

step

PixiVNJsonLabelStep

The step that will be run after the Hashtag-Command, the system will run the Hashtag-Command before running the step, so the operation returned by this function will be executed before the step. The step can be modified by the Hashtag-Command, for example, it can change the dialogue or the goNextStep properties of the step.

props

StepLabelProps

The properties of the step label, it can be used to get information about the step and the label, for example, the label name or the step index. It can also be used to store custom properties that can be accessed by the handlers of the Hashtag-Command.

Returns

Promise<PixiVNJsonOperation | undefined>

The operation to run before the step, if the Hashtag-Command is not valid, it will return undefined and the system will run the step normally.