"Code generation from strings disallowed for this context"

Asked Jul 5, 2022ยท3 repliesยทLast activity 4 years agoยทOpen in Discord โ†—
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Im getting this error from nightbot with this code

$(eval t=`$(touser)`; a=`$(urlfetch json https://pastebin.com/suzcNKDu)`.split(`;`); a[Math.floor(Math.random()*a.length)])

It is supposed to pull from the paste bin and recite a quote from the lines how can i fix this?

3 replies

I think its because you don't have the raw pastebin link

Try this code here:

$(eval t=`$(touser)`; a=`$(urlfetch json https://pastebin.com/raw/suzcNKDu)`.split(`;`); a[Math.floor(Math.random()*a.length)])

It seems to work for me ๐Ÿ™‚

Screenshot_2022-07-06_10.08.44.pngimage.png

@Indigo Turkey
Am i allowed to use you pastes or do i have to make my own?
Thanks

Yes, although some of them might be "split" by other key ( not "," ) so you might have to change your command code a little. Not fully sure :)