Closed phaitonican closed 6 years ago
Hi @phaitonican , thank you very much.
I believe you can do it by handling that part yourself. Something like this:
let targetUsers = ['p0o' 'ned'];
bot.onComment(handleComment);
function handleComment(data, responder) {
// change it on the fly or appoint to a function which synchronously returns the latest changes
targetUsers = ['p0o'];
// exit if author is not in targetUsers
if(!targetUsers.includes(data.author)) return;
console.log('user %s commented!', data.author);
console.log(data.body);
responder.comment('Hi there! I just upvoted you using SteemBot JavaScript library!');
responder.upvote(); // 100% upvote
}
Let me know if it fixes your problem so I can close this issue.
oh i made it work with it, thank you. So it refreshes the variable every time someone comments. Tricky workaround thank you!
Hello p0o, I really appreciate you work. I have a database, where I update the targets. However, do I have the problem to update the targetUsers variable in for example the .onPost() function while the bot is already running. You maybe got an Idea? Thanks!