"Code generation from strings disallowed for this context"

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?

1 Like

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 :slight_smile:
image

2 Likes

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

1 Like

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 :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.