create account

Coding Help Needed for additional WhaleSong Bot Features by cloh76

View this thread on: hive.blogpeakd.comecency.com
· @cloh76 · (edited)
$38.24
Coding Help Needed for additional WhaleSong Bot Features
![Untitled-2.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514585058/aar8ovmvsvmpddu5ryye.jpg)

With the launch of my WhaleSong Voting Bot coming near, I am in a crunch to complete the various features needed in order to make this bot useful and rewarding to all members of the Social Media Community.  I have been asked by a few people if there is a plan to incentivize Steem Power delegators who help donate and contribute to the WhaleSong Bot project.

With that in mind, I would like to reach out to the Utopian-io community for help in adding a daily percentage payout feature to the already existing WhaleSong code.  What I am looking for is something similar to what is already being done for other community driven bots such as @minnowbooster and @utopian-io.

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586139/hzm4qxnqjeqiuhpt2lb1.png)

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586097/hciq7pdfycrxr8oag3bn.png)

I want to add this feature to add another avenue of support and incentive to pay back any contributors to this initiative.  I feel the feature will inevitably help minnows and whales alike to profit from their contributions and not only help the bot to grow, but also members of the contributing community as well.

Currently the WhaleSong Bot uses the following code

<pre><code>const SteemBot = require('steem-bot').default
<br>
const username = 'Your Steem Username';
<br>
const activeKey = 'Your Private Active Key'; 
<br>
function isValidSteemitLink(link) {
  return link.indexOf('steemit.com') > -1;
}
<br>
const bot = new SteemBot({username, activeKey});
<br>
bot.onDeposit(username, handleDeposit);
<br>
function handleDeposit(data, responder) {
  // Only vote if user sent equal or more than 2 Steem or SBD and has a valid Steemit link in memo
  if (parseFloat(data.amount) >= 0.01 &&  isValidSteemitLink(data.memo)) {
    // generate a float number between 1 and 5
    const randomVote = (Math.random() * 4).toFixed(2) + 1;
<br>
    responder.upvoteOnMemo(randomVote)
      .then(() => {
        responder.commentOnMemo(
          `This post received a ${randomVote}% upvote from @WhaleSong thanks to @${data.from}! For more information, click here!`
        );
      });
  } else {
    // We are good people. Just send back the money if is less than 2 or doesn't have the right memo.
    if (data.amount.indexOf('STEEM') > -1) {
      responder.sendSteem(
        data.amount,
        'Sending back the money, should be at least 2 STEEM or SBD with a valid steemit link in memo'
      );
    } else {
      responder.sendSbd(
        data.amount,
        'Sending back the money, should be at least 2 STEEM or SBD with a valid steemit link in memo'
      );
    }
  }
}
<br>
bot.start();
</pre></code>
</pre>
<p>

I am continuing to add features, but am currently stuck on this payout feature that I want to add first.  The additional code should follow the following parameters:

- Code should be in Javascript - currently the bot is coded in javascript
- Bot should payout to SP delegators an adjustable % of actual SBD earnings on a daily basis
- Bot should send a wallet memo dictating the amount paid out daily
- payment should be a % equal to the amount of SP delegated of the overall earnings per day - The bot will only keep SP earned from curation rewards. 
- SBD earned from curation rewards should be converted to SP for the bot

I am seeking the help of more experienced coders (preferably in javascript). I am also open to additional suggestions or recommendations which will help ensure that this bot is profitable for all of its users and I'm hoping over time with the communities help, it can join the more positive and rewarding bots in the Steemit and Utopian community..

Please include the .js file example as well as any required libraries and instructions to edit the code.

Please submit a Pull Request on Github and make a contribution through Utopian.io at the same time so you can be rewarded as well through the platform.  I look forward to the talented input of the community and Thank You again for the help and submissions.

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@cloh76/coding-help-needed-for-additional-whalesong-bot-features">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorcloh76
permlinkcoding-help-needed-for-additional-whalesong-bot-features
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":111477026,"name":"WhaleSong","full_name":"cloh76/WhaleSong","owner":{"login":"cloh76","id":22622264,"avatar_url":"https://avatars2.githubusercontent.com/u/22622264?v=4","gravatar_id":"","url":"https://api.github.com/users/cloh76","html_url":"https://github.com/cloh76","followers_url":"https://api.github.com/users/cloh76/followers","following_url":"https://api.github.com/users/cloh76/following{/other_user}","gists_url":"https://api.github.com/users/cloh76/gists{/gist_id}","starred_url":"https://api.github.com/users/cloh76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloh76/subscriptions","organizations_url":"https://api.github.com/users/cloh76/orgs","repos_url":"https://api.github.com/users/cloh76/repos","events_url":"https://api.github.com/users/cloh76/events{/privacy}","received_events_url":"https://api.github.com/users/cloh76/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cloh76/WhaleSong","description":"New Upvoting Bot with a Twist","fork":false,"url":"https://api.github.com/repos/cloh76/WhaleSong","forks_url":"https://api.github.com/repos/cloh76/WhaleSong/forks","keys_url":"https://api.github.com/repos/cloh76/WhaleSong/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloh76/WhaleSong/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloh76/WhaleSong/teams","hooks_url":"https://api.github.com/repos/cloh76/WhaleSong/hooks","issue_events_url":"https://api.github.com/repos/cloh76/WhaleSong/issues/events{/number}","events_url":"https://api.github.com/repos/cloh76/WhaleSong/events","assignees_url":"https://api.github.com/repos/cloh76/WhaleSong/assignees{/user}","branches_url":"https://api.github.com/repos/cloh76/WhaleSong/branches{/branch}","tags_url":"https://api.github.com/repos/cloh76/WhaleSong/tags","blobs_url":"https://api.github.com/repos/cloh76/WhaleSong/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloh76/WhaleSong/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloh76/WhaleSong/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloh76/WhaleSong/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloh76/WhaleSong/statuses/{sha}","languages_url":"https://api.github.com/repos/cloh76/WhaleSong/languages","stargazers_url":"https://api.github.com/repos/cloh76/WhaleSong/stargazers","contributors_url":"https://api.github.com/repos/cloh76/WhaleSong/contributors","subscribers_url":"https://api.github.com/repos/cloh76/WhaleSong/subscribers","subscription_url":"https://api.github.com/repos/cloh76/WhaleSong/subscription","commits_url":"https://api.github.com/repos/cloh76/WhaleSong/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloh76/WhaleSong/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloh76/WhaleSong/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloh76/WhaleSong/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloh76/WhaleSong/contents/{+path}","compare_url":"https://api.github.com/repos/cloh76/WhaleSong/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloh76/WhaleSong/merges","archive_url":"https://api.github.com/repos/cloh76/WhaleSong/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloh76/WhaleSong/downloads","issues_url":"https://api.github.com/repos/cloh76/WhaleSong/issues{/number}","pulls_url":"https://api.github.com/repos/cloh76/WhaleSong/pulls{/number}","milestones_url":"https://api.github.com/repos/cloh76/WhaleSong/milestones{/number}","notifications_url":"https://api.github.com/repos/cloh76/WhaleSong/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloh76/WhaleSong/labels{/name}","releases_url":"https://api.github.com/repos/cloh76/WhaleSong/releases{/id}","deployments_url":"https://api.github.com/repos/cloh76/WhaleSong/deployments","created_at":"2017-11-21T00:12:24Z","updated_at":"2017-11-21T00:12:36Z","pushed_at":"2017-11-21T00:12:34Z","git_url":"git://github.com/cloh76/WhaleSong.git","ssh_url":"git@github.com:cloh76/WhaleSong.git","clone_url":"https://github.com/cloh76/WhaleSong.git","svn_url":"https://github.com/cloh76/WhaleSong","homepage":null,"size":3820,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","network_count":0,"subscribers_count":0},"platform":"github","type":"task-development","tags":["utopian-io","task","help","bot","steemit"],"users":["minnowbooster","utopian-io.","WhaleSong"],"links":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1514585058/aar8ovmvsvmpddu5ryye.jpg","https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586139/hzm4qxnqjeqiuhpt2lb1.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586097/hciq7pdfycrxr8oag3bn.png"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1514585058/aar8ovmvsvmpddu5ryye.jpg","https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586139/hzm4qxnqjeqiuhpt2lb1.png","https://res.cloudinary.com/hpiynhbhq/image/upload/v1514586097/hciq7pdfycrxr8oag3bn.png"],"moderator":{"account":"espoem","reviewed":true,"pending":false,"flagged":false}}"
created2017-12-29 22:41:09
last_update2018-01-05 03:28:00
depth0
children1
last_payout2018-01-05 22:41:09
cashout_time1969-12-31 23:59:59
total_payout_value26.849 HBD
curator_payout_value11.393 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,342
author_reputation37,996,316,912,544
root_title"Coding Help Needed for additional WhaleSong Bot Features"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id25,952,513
net_rshares3,578,528,532,505
author_curate_reward""
vote details (43)
@utopian-io ·
### Hey @cloh76 I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Suggestions
- Contribute more often to get higher and higher rewards. I wish to see you often!
- Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!
#### Get Noticed!
- Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-cloh76-coding-help-needed-for-additional-whalesong-bot-features-20180103t014609290z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-01-03 01:46:09
last_update2018-01-03 01:46:09
depth1
children0
last_payout2018-01-10 01:46:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,426
author_reputation152,955,367,999,756
root_title"Coding Help Needed for additional WhaleSong Bot Features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id26,671,748
net_rshares0