So ive been using the following command to pull a random line from Pastebin:
$(eval a=$(urlfetch json https://pastebin.com/raw/KPikmQV4)
.split(;
);a[Math.floor(Math.random()*a.length)])
The above line is an example tied with the command !acemanpick (who is a member for my channel).
It has worked fine for the past year, but in my latest stream it started bugging out. The pastebin file contains 10 lines that represents 10 different characters. It represents my members “team” and theyre going to head to head with someone else. When a character is called into the chat and loses, I then cut the line of the character and move it to another pastebin file temporarily until they either lose all their characters or they defeat all of their opponent’s character. The problem is when I remove the lines of characters, after the “pick” command is used again, Nightbot will return the deleted characters sometimes. I spent over 6 hours streaming today, trying different things, changing the code, refreshing pastebin and nightbot after every change, waiting a minute before using the command again. But it would still return deleted lines. Idk if anyone can help me or understands, but ive been struggling trying to figure out why Nightbot seems to be returning lines that arent part of the file anymore.. Any help is highly appreciated.