Skip to content

Its commenting nearly some time 5 or some time 10 or working fine don't know whats Wrong  #15

Description

@tomriddle54

I have Created a Bot for an introduction but sometimes its working fine and some time commenting more than 1 time and he has done 10 comments in one post don't know whats wrong here can any one help here is the code

// No need for the line below if your environment already supports ES6 with JavaScript import/export
require('babel-register');

// change the line below to:
// const SteemBot = require('steem-bot').default
// or:
// import SteemBot from 'steem-bot';
const SteemBot = require('../src/loader').default;


const username = '';
const postingKey = ''; 

const targetUsers = ['kamesh']; rs
const bot = new SteemBot({username, postingKey});

//bot.onComment(handleComment);
bot.onPost(handlePost);

function handlePost(data, responder) 
{
	tagg=data.json_metadata;
	obj = JSON.parse(tagg);


if (obj.tags.indexOf("introduceyourself") > -1)
 {
	console.log("did it ");
	
     responder.comment('Hi Thank you for #introducingyourself. Im myself quite new in steemit community but I realized that there are few things you could do to have a better start: \n Mostly I invested a little bit in STEEM in order to purchase STEEM POWER and STEEM DOLLARS. Why? Its simply important. Without initial investment it will be very hard for you to build reach here and be noticed.\n \n Im not sure if you ever heard about this site: \n http://steemd.com/@your_username \n Example: https://steemd.com/@example \n Perhaps you know it already :) \n If you will reply to this message (that would allow me to believe that we may develop mutual engagement and help each other) then I will follow you and upvote some of your future posts. \n Cheers and good luck.').catch((err) => {
    console.log('Some error happened while posting comment');
  
  });
	


 }


}



bot.start();



Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions