Skip to content

[Bug] Firebot seems to have difficulty parsing arrays added directly to the $arrayRandomItem variable #3058

@CrowbarToolsRobot

Description

@CrowbarToolsRobot

Description

An array needs extra quotation marks, square brackets and escape characters before it can be used with $arrayRandomItem. This can be avoided by using an array saved to a custom variable rather than directly adding the array to $arrayRandomItem.

Steps to Reproduce

  1. Create a log message command with
Array 2: $arrayRandomItem[["one", "two", "three"]]
Array 3: $arrayRandomItem[[\"one\", \"two\", \"three\"]]
Array 4: $arrayRandomItem["[\"one\", \"two\", \"three\"]"]```
2. View logs to see that only array 4 produces a random item.
### Expected Behavior
Log message should look something like this:
"Array 1: 
Array 2: ]
Array 3: ]
Array 4: two"

Array 2 and 3 will always show a closing bracket.
### Firebot Version
v5.63.2
### Submitted By
oshimia

> Created via Discord.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions