Community Bot - A Voting Bot for Steem Communities

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

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now