Right-hand side of ‘instanceof’ is not an object

So I’m trying to make a wiki command by using this info: https://docs.nightbot.tv/commands/variables/urlfetch

But it somehow it appears this error “Right-hand side of ‘instanceof’ is not an object”

!commands add !wiki Wikipedia Article: $(eval const api = $(urlfetch json https://en.wikipedia.org/w/api.php?format=json&action=opensearch&search=$(querystring)); api.error || !api[1][0] ? ‘Please add a query to the search’ : ${api[1][0]} - ${api[3][0]})

Can someone help me with this?

@deatron

!addcom -cd=5 !wiki $(eval a=$(urlfetch json https://en.wikipedia.org/w/api.php?format=json&action=opensearch&search=$(querystring));a.error||!a[1][0]?`Please add a query to the search!`:`Wikipedia Article: ${a[1][0]} - ${a[3][0]}`)

Thanks, It worked. Really appreciated for the response :slight_smile: Cheers!

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