You are viewing a single comment's thread from:

RE: 🤖 TUTORIAL - Statistics Responder - Building bots With steem-js #8

in #utopian-io8 years ago

Thanks for sharing Sam(@sambillingham). The rewards on your post must convey that people are finding them useful ;)

I built a utility bot using a similar approach. But whenever the post/comment is updated the bot keeps replying as I an not able to differentiate between creation/updation. Is there a way I can identify this directly from steem.api.streamTransactions function without getting the details of the post in a separate API call?

Sort:  

hey @gokulnk I've not actually looked into this so I'm not 100% sure. Is there a creation or update date in the data you could compare? I believe what other tools do is keep their own database of transactions, that way you can check the if the ID or permlink has been used before. if you don't want to setup and keep a database you could use http://steemdata.com instead.

I used
steem.api.getContent(txData.author, txData.permlink, function(err, result) { if (result.active != result.created) {

But I would have preferred if I could have avoided the additional API call.

Coin Marketplace

STEEM 0.08
TRX 0.30
JST 0.035
BTC 110018.00
ETH 3859.03
USDT 1.00
SBD 0.52