Creating A Cryptocurrency Price Command for Nightbot

Asked Jan 7, 2024·9 replies·Last activity 2 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.

9 replies

Can you post the command message you're using?

I'm not a programmer so I copied this one from another forum post I saw.

$(eval 1/$(urlfetch json <Api key link>)).display.4

with the api link in the middle. I can't post links

Hey @Crisp Turkey!

Can you share the response you get from the API? I get a forbidden response.

Crisp Turkey said:
$(eval 1/$(urlfetch json )).display.4

This isn't the proper way to reach the data, you need to stay inside the $(eval) and when you have an array containing the data, this isn't how you reach the 4th item, an array starts at 0.
This would be closer to what you're looking for:

$(eval $(urlfetch json API_LINK).display[3])

Unexpected identifier 'Connecting' [<context>:1:9].display.4

This is what it displays for the code snippet you provided: Unexpected identifier 'Server' [<context>:1:8]

I also get a forbiden response if I call it outside of dextools api creator: go to dextool api creator

Use: bsc

token address: 0xe34B5DF7EabacAdf00cFB005dd707CC64cD01856

i'm guessing here, but based on the language, it sounds like maybe that api isn't a finished product, like it's still in some sort of testing phase or something (since it can only be reached within "dextool api creator")... my best guess is to look for some kinda option to make the api "go live" or whatever terminology they use

This still doesn't help, we can't get the output of the API when we open the link in the browser or fetch it with Postman, please provide with an example of what the API's output look like, either a screenshot, or preferably text (copy/paste), it can even be mock-up data, as long as the keys are representative of the response.
Btw, if we can't get the data now, I doubt Nightbot can as well, therefore I don't think the command can work, at least until the API responds with data.

Didn't find your answer? The community is on Discord.

Ask on Discord