Hi, does Nightbot have any kind of mechanism to remember session variables in eval commands, or even its own native implementation outside of eval?
For example if i were to assign a random number of 1 to 10 to a user when they call a command !random, what i’d wanna do is store it, so that when they do it a second time, i can be like “your number is already 7” instead of generating a new one for them.
Nightbot doesn’t keep track of information like this by itself. You could use an alias of !editcom to record a random number or use ehsankia’s quote custom API to record your random numbers: [CustomAPI] Quote system
Two commands. One displays text, one uses !editcom to change the text of the former:
!addcom -cd=5 !currentnumber Your current number is:
!addcom !randomnumber -a=!editcom !currentnumber Your current number is: $(eval Math.ceil(Math.random()*10))
Whenever you run !randomnumber, it will generate a random number from 1 to 10 which it will use to edit the response of !currentnumber