Community Bot - A Voting Bot for Steem Communities

in #utopian-io6 years ago (edited)

communitybot.jpg

I recently built a community-based voting bot for the #TheAlliance and have published the source code to GitHub (with their blessing) so that other communities on Steem can use it as well if they would like.

The bot has a list of members who either delegate a certain amount of Steem Power or pay a certain amount of liquid STEEM monthly (depending on the settings), and it simply goes through the list of members and upvotes their last post. This way members of a community can all chip in a little bit to build up a nice upvote every so often for their posts.

Membership Settings

The software currently contains the following settings for determining membership:

  "membership": {
    "start_date": "2/20/2018",  // Date when membership starts
    "membership_period_days": 30, // The length of time for which the dues pay
    "delegation_vests": 60000,  // Min amount of delegation required for membership
    "full_delegation_vests": 120000,  // Min amount of delegation required for membership with no dues
    "dues_steem": 1,  // Dues required if delegation is less than "full_delegation_vests"
    "dues_steem_no_delegation": 2 // Dues required of delegation is less than "delegation_vests"
  }

There are a few options for becoming a member. In the example above, if someone delegates 120,000 VESTS (~ 60 SP) then they are a member as long as their delegation remains as indicated by the "full_delegation_vests" property.

Alternatively if someone does not want to delegate then they can pay 2 STEEM for a 30 day membership as indicated by the "dues_steem_no_delegation" and "membership_period_days" properties.

And finally there's an in-between option where someone may delegate 60,000 VESTS (~30 SP) and pay 1 STEEM for a 30 day membership as indicated by the "delegation_vests" and "dues_steem" properties.

Each community that runs such a bot can choose which of these options they want to support and what the required delegation and/or dues amounts are.

Sponsorship

There is also an option for members to be able to sponsor other members to join, for example if someone doesn't have enough STEEM or SP to pay / delegate. To sponsor another member you would send a transfer memo to the bot in this format:

$sponsor @username

This will apply the amount of VESTS specified in the "full_delegation_vests" property from the user who sent the transfer memo to the user specified by "@username", assuming the user who sent the memo has delegated enough to cover that. Currently sponsorship is only supported via the SP delegation option.

API

The software also includes an API to see the current list of members and their settings. This is exposed as "/api/members" endpoint and will return a JSON array like the following:

"members": [
{
"name": "member_account_1",
"valid_thru": "2018-02-20T01:23:20.774Z",
"vesting_shares": 122820.475855,
"total_dues": 0,
"joined": "2018-02-20T01:23:20.773Z",
"sponsoring": [],
"sponsor": null,
"full_delegation": true
},
{
"name": "member_account_2",
"valid_thru": "2018-07-20T01:23:20.774Z",
"vesting_shares": 0,
"total_dues": 10,
"joined": "2018-02-20T01:23:20.774Z",
"sponsoring": [],
"sponsor": null,
"full_delegation": false
},
...

In the example above you can see that "member_account_1" has delegated over 120,000 VESTS so they have a full membership as long as their delegation remains. The "valid_thru" property is not applicable in this case when "full_delegation" is set to true.

The second member - "member_account_2" - has paid 10 STEEM in dues, meaning they have purchased 150 days of membership (since 2 STEEM buys 30 days based on the example settings used). In this case the "valid_thru" property shows how long their membership is currently valid.

You can also see if the member was sponsored by another member or if they are sponsoring any other members.

Run a bot for your community

As I mentioned this was built specifically for #TheAlliance and as such the features were made to cater to their specific needs. The code is open source so you can feel free to modify it as necessary to support the needs of your community.

If you would like some help hosting/running/modifying the bot for your community feel free to reach out to me on Discord or Steemit.Chat and hopefully we can work something out!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Always working pro-community and pro-blockchain, that's why you have my witness vote, always!

Wow this is impressive! It looks like a lot of work, but what do I know, I can barely code a macro on my excel spreadsheets.

I’m interested to see how communities adopt this, I’ve been on Steemit a month but I mostly see power dynamics of a powerful Steemian and their followers. I haven’t encountered many communities yet, but maybe I’m not looking hard enough!

Welcome! There are a lot of communities, which is a great thing. One of the largest is @minnowsupport. I would recommend checking them out.

Cool stuff, thanks for sharing it! Maybe you can do a tutorial on @utopian where you explain how the code works :) tip!

Thanks for the tip - I'll definitely consider doing a tutorial on Utopian, just need to find the time!

Excellent work @yabapmatt. Very helpful for many communities!! Amazing!!

It would be interesting to add different levels, like @qurator does (tiers) :)

Awesome idea!

@yabapmatt, kudos to you man! I wish i never gave up on my programming skills, nonetheless, i still love what I currently do tho.

How long did it take you to write the bot?

If you love what you do that's all that matters! Hard to say how long it took. I was able to re-use a lot of code from the post promoter software and I worked on it in little bits here and there when i had time. It wasn't a whole lot of work though since it was mostly just modifying code i've already written.

That's cool..
But I have one question?
How does the bot give upvotes, is it just like the other bots where your bid determines the upvote worth.
Sorry for being a complete noob

No this is not a bid-based voting bot, it just gives a 100% weight vote to the latest post to each member in the list.

Then that's cool ...
Isn't there a discord channel to this where I can learn more.
I want to register for this

@Yabapmatt just keeps giving. And from his free time. Bless you.🙌🏾🙌🏾🙌🏾

Good work! Thanks for making it open source!

Its guys like you that make steemit rock, thanks for that

Hahah steemit roker

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64093.86
ETH 3123.80
USDT 1.00
SBD 3.94