Bitcoin value command?

Hi, i want to know if there is a way to create a command that says the bitcoin value and it update automatically if change. Thanks.

@jotammz98 Yeah, I found this API [ https://api.coindesk.com/v1/bpi/currentprice.json ]. It’s free and you can use this.

!addcom -cd=5 !btc $(eval x=$(urlfetch json https://api.coindesk.com/v1/bpi/currentprice.json); try { `Last Update: ` + x.time.updated + ` | Rate: 1 Bitcoin = ` + x.bpi.USD.rate + `$` } catch(e) { " " })

Example usage:

Ritik: !BTC
Nightbot: Last Update: Dec 1, 2020 10:39:00 UTC | Rate: 1 Bitcoin = 19,743.1221$

If you face any error let me know, I will fix it.

Regards

2 Likes

it work, thank you so much!

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