AJ59
1
I am trying to add a !dadjoke command that when called it random dad jokes from a pastebin link, but so far I’ve been running into errors and error.
The command:
!addcom !dadjoke $(eval responses = $(urlfetch json https://pastebin.com/raw/wKzWNmgQ):responses[Math.floor(Math.random() * responses.length)])
Error message:
Unexpected token ‘:’
any help is appreciated
Hiya, try this:
$(eval responses = `$(urlfetch json https://pastebin.com/raw/wKzWNmgQ)`.split(`Q:`); `Q:` + responses[Math.ceil(Math.random() * responses.length)])
1 Like
AJ59
3
Thank you so much. It worked like a charm!
system
Closed
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.