Firebot icon indicating copy to clipboard operation
Firebot copied to clipboard

$arraySlice incoherent use of start and end

Open dontcallmechicken opened this issue 8 months ago • 0 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

$arraySlice[array, start, end] The variable uses the index number of the item from the original array as the starting point. The position of the item from the original array is used for the end point.

Expected Behavior

I would expect the start point and end point to be set in the same way, either by index number or by positions in the array.

If this is what is intended and should remain the case, then a clear explanation in the description of the variable would be helpful.

Current description:

$arraySlice[array, start, end] Returns a slice of an array

Steps To Reproduce

Example 1

$arraySlice["[\"Index 0\", \"Index 1\", \"Index 2\", \"Index 3\"]", 0, 3]
[ "Index 0", "Index 1", "Index 2" ]

Example 2

$arraySlice["[\"Index 0\", \"Index 1\", \"Index 2\", \"Index 3\"]", 0, 1]
[ "Index 0" ]

Example 3

$arraySlice["[\"Index 0\", \"Index 1\", \"Index 2\", \"Index 3\"]", 1, 2]
[ "Index 1" ]

Version

5.64.0 (deb)

What operating system are you using Firebot on?

Linux Distro

Contact Details (Optional)

Discord: DCMC, dontcallmechicken.dcmc

dontcallmechicken avatar Apr 13 '25 15:04 dontcallmechicken