I’m having trouble trying to get a Nightbot variable from a Pastebin URL. The goal of the command is that Nightbot will random grab one entry from the list of sentences and within that sentence it will grab a random users @.
Here is the pastebin it references: https://pastebin.com/raw/2ULccb6v
and here is the output:
has buttered $(urlfetch http://2g.be/twitch/randomviewer.php?channel=$(channel)) 's buns.
Well I presumed you knew how to fill in the blanks in the command. Like replacing pastebin_link and splitting_character the code should work also why is there a second eval? You can also check out what @Emily said if you need it to all be pre made for you.
So, I assume in your Pastebin are the different possible responses Nightbot can pick from, first you’ll want to fix those a bit:
`${u} has spread a load of butter on ${r}.`
`${u} has buttered ${r}'s buns.`
`${u} has let ${r} hold their stick of butter!`
Now, nowhere in your code you make Nightbot pick the response, here’s how I’d do it:
(this is the code that goes in your Pastebin)
const responses = [`${u} has spread a load of butter on ${r}.`,
`${u} has buttered ${r}'s buns.`,
`${u} has let ${r} hold their stick of butter!`];
responses[Math.floor(Math.random() * responses.length)];
And finally, we need to fix the rest of your code, your text variables must be marked as such:
Filter out users from the randomly picked ones? You should have mentioned it sooner, also, you could have found the solution by searching for random user filter in the forums: