@ChanMbot 6.0.0 – Markdown boostup? BitCoin price!!!

Bitcoin price is falling down and going up again… How to check this price??? If you like JSON you can check it here: https://blockchain.info/ticker . But maybe you don’t like JSON and you are crypto currency channel owner?

IN THIS UPDATE!!!!!!

you can check BTC price using ((btc)) in any message! How to do this? Look:

At top of our code we need to add:

var request = require('request');
var btcpurl = "https://blockchain.info/ticker"

And we need to type:

$ npm install

Then we need to find /md command.

After this:

We need to add let btcPrice;

After this we need to add:

request.get(btcpurl,
function(error, response, body) {
usdPrice = JSON.parse(body).USD[“15m”];

Then we need to replace ((btc)) with usdPrice

:

let message = msg.text.replace(‘((btc))’ usdPrice)
let message1 = message.replace(‘/md ‘, ”);

Ok..

Bug found . (again..)

So:

Move this: request.get(btcpurl,
function(error, response, body) {
usdPrice = JSON.parse(body).USD[“15m”];

At top we need to add:

var usdPrice;

And remove let usdPrice; from /md.

Done! Debug in 6.0.1

Leave a Reply

Your email address will not be published. Required fields are marked *