UrlFetch example

Asked Jul 17, 2020·4 replies·Last activity 6 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.

4 replies

The problem isn't SSL, it's the missing template string quotes from the documentation code:

!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]} )

vs

!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]}* )

where * should be `

They're not missing per se, but they're not visible on the docs because it looks like they are used for formatting on said docs.

Correct, that's what i said in my comment.

Indeed you did, apologies. Might've not read it at first glance lol =)