I tried to use the other posts that I’m sure covers my issue but I couldn’t get anything to function. I just want a Nightbot to return a random response from a pastebin but every version of the commands I find on here leads to “Code generation from strings disallowed for this context”. That makes me think it’s something within the pastebin itself, but I couldn’t find anything about it either.
I need a command to just pick one of these to say please ):
the error you were receiving was because you were calling a non-raw Pastebin.
you would only have gotten the 2 first options at random: Math.floor(Math.random() * N) gives you a random integer between 0 and N-1,
here satfact.length is equal to 3, so it’ll give you a random number between 0 and 2,
and the first item of an array is always at index 0 and the last one at length - 1.
about the first solution:
you would have had an issue because you put the $(urlfetch) between double quotes " and tried to split it to build an array, when it already is an array.
about the second solution:
you build your array this way when you have a string as input, I replaced the comma with a semicolon since they’re less used.