Interface CompanionActionContext

Utility functions available in the context of the current action

interface CompanionActionContext {
    parseVariablesInString(text: string): Promise<string>;
    setCustomVariableValue(
        variableName: string,
        value: CompanionVariableValue,
    ): void;
}

Hierarchy

  • CompanionCommonCallbackContext
    • CompanionActionContext

Methods

  • Parse and replace all the variables in a string Note: it is important to use this version when in a feedback, so that the feedback will react properly when the variables parsed change

    Parameters

    • text: string

      The text to parse

    Returns Promise<string>

    The string with variables replaced with their values

  • Parameters

    Returns void

    Promise which resolves upon success, or rejects if the variable no longer exists

    Experimental: This method may change without notice. Do not use! Set the value of a custom variable