Skip to content

$math variable fails if only a number return variable is passed as argument #3364

@dennisrijsdijk

Description

@dennisrijsdijk

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If $math is used with only a number return variable (eg. $math[$randomNumber[0,100]] or $math[$chatUserCount]), it returns -1 and warns with a failure message in the console

Expected Behavior

if a number-typed value is entered into $math, it should correctly be returned

Steps To Reproduce

  1. Create a Log Message Effect
  2. Add $math[$randomNumber[0, 100]]
  3. Run the effect
  4. Observe in the logs, it warns with a failure message and logs -1

Version

v5.65.0

What operating system are you using Firebot on?

Windows 11

Relevant log output

[2025-12-10 20:49:20.863] [WARN] error parsing math expression "Unexpected type of argument in function evaluate (expected: string or Array or Matrix or boolean, actual: number, index: 0)"
[2025-12-10 20:49:20.864] [DEBUG] Running firebot:log-message(b3547745-8dfa-463f-950f-0728fd38b277) effect...
[2025-12-10 20:49:20.864] [INFO] -1

Contact Details (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions