Community Helper

As you have read above community manager will be able to set curators or moderators and will also be able to add max vote weight so even by mistake no one will be able to give higher upvote than needed. To upvote a post, curator must follow this syntax ``` !upvote [vote_weight]```
Other than upvoting bot also allows resteems and process of resteem is much simpler than process of upvoting. The bot finds a comment "!resteem" then it checks whether the author of the bot is in the list of trusted curators, if yes then bot upvotes the post. ### How to setup? I have tried to make this bot as easy to setup as I can. First you will need to install Python 3.6 and Steempy which you can do by following [this awesome tutorial](https://steemit.com/utopian-io/@amosbastian/how-to-install-steem-python-the-official-steem-library-for-python) by @amosbastion. After installing those two things, open up the terminal and make sure you are using Linux. In terminal, type "touch community_helper.py" which will create a new python file. Now type "nano community_helper.py", it will open a text file editor in the command. Now copy the code from [here](https://github.com/anonfiles/community_helper/blob/master/Community%20Helper.py) and edit it according to your needs. I have added comments to help you edit the code, you mainly have to edit the variable to your needs and add keys. ### Technology Stack To make this project, I have used Python language and also used the help of Steempy to interact with Steem Blockchain. ### How to contribute? Suggestions for this project are most welcome and I will be more than happy to implement them, if they are really good. ### Code ``` # Community Helper # Imports from steem import Steem from steem.blockchain import Blockchain from steem.post import Post
Variables
s = Steem(nodes=["rpc.steemviz.com"], keys=["Private_Posting_Key",
"Private_Active_Key"]) # Add Keys
blockchain = Blockchain()
stream = map(Post, blockchain.stream(filter_by=["comment"]))
Adjustable Variables
account = "ACCOUNT" # Account That Will Be Used For Upvoting
curators = ["CURATOR1", "CURATOR2", "CURATOR3"] # Add Curators/Moderators (without @)
max_voting_power = 100 # You can obviously change it
Function
def parent_link() # Function to return parent link of the comment.
link = "@" + post["parent_author"] + "/" + post["parent_permlink"]
return link
Process
while True:
try:
for post in stream: # Checks every comment
comment = (post["body"][:7])
comment2 = (post["body"][:8])
if comment == "!Upvote" or comment == "!upvote": # If comment is !upvote or !Upvote
print("Found A Comment %s" % post["title"])
voting_weight = float(post["body"][8:])
if post["author"] in curators and voting_weight <= max_voting_power: # Checks if curator is in list of curators and vote weight is lower than max vote weight.
print("Commentator is in curators list")
voting_weight = float(post["body"][8:])
s.commit.vote(parent_link(), voting_weight, account) # Upvotes the post
post.reply("I Just Gave You %s Percent Upvote!" % voting_weight, "Upvote %s Post" % [post["title"]],
account)
print("Post Upvoted")
elif post["author"] in curators:
print("Commentator is using more than max voting weight allowed")
post.reply("%s Give Vote Of Under %s Voting Weight" % (post["author"], max_voting_power)
, "Can't Upvote", account)
elif voting_weight <= max_voting_power:
print("Commentator is not in curators list")
post.reply("%s Sorry, You Are Not Eligible To Vote" % (post["author"])
, "Can't Upvote", account)
elif comment2 == "!resteem" or comment2 == "!Resteem" and post["author"] in curators: # Checks if comment is !resteem or !Resteem and author is in curators list
post.resteem(parent_link(), account) # Resteems the post
post.reply("Post Resteemed!", "Resteemed", account)
except Exception as error:
print(repr(error))
continue