funfacts command

Hey so I’m trying to get a command setup so it can pull random funfacts from my pastebin to my chat, but when I enter the command I just get this…
!addcom -cd=5 !truefacts Unexpected identifier
this is the command language I add in the message section.
!addcom -cd=5 !truefacts $(eval a=$(urlfetch json;a[Math.floor(Math.random()*a.length)])
if everyone can help me it would be appericated.

Hey @expboosterboii!

You fetch the paste, but you forget to turn it into an array.

$(eval a=`$(urlfetch json`.split(`;`);a[Math.floor(Math.random()*a.length)])
1 Like

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