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.
Bitcoin value command?
2 replies
@Grand Ant 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: !BTCNightbot: 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