Nightbot variable bug

Nightbot’s “variables” are not evaluated if they are within three or more other variables.

In this command the variables are evaluated evaluated correctly - $(user) inside one $(querystring) inside one $(eval)

!commands add !evaltest $(eval decodeURIComponent(`$(querystring $(user))`))

After typing !evaltest, Nightbot replies with my Twitch username.

In this command the innermost variable isn’t evaluated - $(user) inside two $(querystring) inside one $(eval)

!commands add !evaltest $(eval decodeURIComponent(decodeURIComponent(`$(querystring $(querystring $(user)))`)))

After typing !evaltest, Nightbot replies with $(user)

This bug is especially apparent in an $(eval), but the problem exists with regular commands too:

!commands add !evaltest $(querystring $(querystring $(querystring $(user))))

After typing !evaltest, Nightbot replies with %252524(user)

That is not a bug. For asynchronously evaluated variables we allow only 2 levels of nesting.

Can you please increase the maximum level of nesting? With only two it’s impossible to do $(eval $(urlfetch $(querystring $(user)))) which I need for a command.

Also the $querystring doesn’t work if they in a quote and both inside in an eval

Are you sure you’re using $(querystring), not $querystring ?

Oh sorry,is $(querystring) not $querystring
well,seem maximum level of nesting is main problem? because this limit,you never can do a commands like this:

$(eval var p="$(touser)",q="$(urlfetch http://twitch.center/customapi/quote?token=de83b97b&no_id=1&data=$(touser))";if(q.indexOf("$(touser)")!==-1){“Today you are already checked in,please come tomorrow!”}else{"$(urlfetch http://twitch.center/customapi/addquote?token=2c918790b386a896&data=$(querystring $(touser)))";p+“check in successfully,get five 932 coin”;})

Although it just a simple check in command

We are not willing to increase the level of nesting at this time, sorry. We limit it this way to prevent abuse and ensure any one command cannot use too many resources during execution. In the future we might have a better way to do what you wish other than nesting.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.