You are viewing a single comment's thread from:

RE: TUTORIAL - Beginner - Build your own Steem Upvote Bot - JavaScript - Part 3

in #utopian-io6 years ago (edited)

For anyone who is late to the party, like I am, you may find some links broken. You can find some parts of this tutorial by just adjusting the number in the url.

The error in the code, that is mentioned by some is this

function refund(sender, amount) {
      steem.broadcast.transfer(config.private_active_key, config.account_name, sender, amount, '', function (err, response) {
   if (err || !result) {
       console.log("Refund failed ! For: " + sender);
    }
  }
});
}

the callback function uses function (err, response). So the values you want to check are err and response.
The checking code however cheks for err and result (which is an understandable mistake when writing code)

So change
if (err || !result) {
to
if (err || !response) {

and you should be fine.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.029
BTC 60773.82
ETH 2378.63
USDT 1.00
SBD 2.57