You are viewing a single comment's thread from:

RE: TUTORIAL - Beginner friendly - Build your first steem bot in Javascript - 30minutes

in #utopian-io7 years ago

For this particular version of js file can you post the code for post comments?


var parentAuthor = 'author1';
var parentPermlink = 'permlink;
var commentPermlink = steem.formatter.commentPermlink(parentAuthor, parentPermlink);
var postTitle = WELCOME_COMMENT_TITLE;
var postBody = WELCOME_COMMENT_BODY;

steem.broadcast.comment(ACCOUNT_WIF, parentAuthor, parentPermlink, ACCOUNT_NAME,
commentPermlink, postTitle, postBody,
{"tags":["tag1"]},
function(err, result) {
console.log(result);
});

The above code doesn't seem to work and the version specific changes are not documented well enough I think.

Sort:  

Hey @gokulnk, can you be a little more clear so I can help you out?

  • Where is this code from? (it's not this tutorial)
  • What do you mean by 'code doesn't work' - what error messages are you getting, what is happening?
  • What are you wanting to do?
  • Can you post your full code somewhere?

The code you have given in your sample works perfectly.

I was just trying to build on it to add comments to a post.

I keep getting the following error.

"Expected version 128, instead got 149"

Please let me know if you were able to post comments through the code.

okay thanks for clarifying, it's 100% possible to send comments through code.

See this broadcast function - https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L183

notice the operations array on line 150 - https://github.com/code-with-sam/steem-versary-bot/blob/master/bot.js#L150

Looks like I am having issues with all the broadcast functions. stream functions are working fine though.

Let me know if we can discuss this in steemchat.

perhaps you are trying to do steem.api.broadcast() when it should be steem.broadcast() ?

Also check you're not redefining steem anywhere?

p.s post your full code as a gist!

For ACCOUNT_WIF I was using the actual password and not the posting key. After changing that it is working well. Since it was WIF related issue other calls were working and only those where WIF was involved were throwing the error.

I wish the message was little more verbose. It could have saved me a lot of time :P

Thanks for your inputs.

Coin Marketplace

STEEM 0.32
TRX 0.26
JST 0.040
BTC 97628.16
ETH 3611.02
USDT 1.00
SBD 3.42