Steemflagrewards discord bot - Code rewrite and many new features

@flugschwein · 2018-08-06 16:39 · busy

Repository

https://github.com/anthonyadavisii/steemflagrewards

What is steemflagrewards

@steemflagrewards is an initiative on the steem blockchain trying to make more users of the blockchain actually flag abuse themselves. We are doing this by upvoting the comments these users leave under the flagged post or comment. For the approval of these comment we have a discord bot which automatically upvotes and sometimes comments these comments. There also is a post that triggers once 9 distinct flaggers have got a mention approved. These posts look very similar to this one and they have set the flaggers as beneficiaries with adjustive weight dependent on the number of mentions approved.

New Features

Actually I nearly completely rewrote the script with new features and many other smaller things. The following are the major changes I did.

1. Persistent data storage and 100% beem

The first version of the script by @anthonyadavisii always stored the things that would be used later, such as the several mentions and their authors for the beneficiary posts, in variables. This was problematic, because if the script crashed for whatever reason (such as the hosting PC to be restarted) all the variables would be lost. I fixed that problem by storing all the stuff that needs to be stored for a longer time in a local SQLite database. Another big stability change was the complete transition from steem-python to beem, it's superior small brother, who is slowly outgrowing steem-python. Relevant commit

2. ?status command

I added a command that shows the current status of the @steemflagrewards bot. The important (non joke) values in the message are the following: * Flaggers - the number of distinct flaggers with approved mentions not yet included in a post * Mentions - the number of mentions approved but not yet included in a post * Removed payouts in the last 7 days - title is descriptive enough. In STU. * Steem Power - the effective Steem Power of @steemflagrewards * Voting Power - the VP of @steemflagrewards * Vote Value - the value of a 100% by @steemflagrewards at the current VP * Reputation - the reputation of @steemflagrewards. * Latest Post - the latest post by @steemflagrewards.

A status message looks like this: Relevant commit

3. ?sdl command

Lately there have been a lot of newly created accounts flagging other users seemingly random. We do believe it's only one person who own these accounts, and he calls himself the steemit defence league. @iamstan and some others from the steemflagrewards team have started to maintain a list of all the accounts involved. In order to make this list easier and more comfortable to maintain, I created the ?sdl command. It has a small set of subcommands for it's usage: * add: For adding new accounts to the list. Usage: ?sdl add {any number of accounts seperated by whitespaces} * remove: For removing accounts from the list, if they have been added even though not being part of the sdl. Usage: same as add * list: Lists all accounts currently on the list. If they are requested with either steemd or steemit links, they will get sent in embed messages because normal messages don't support hyperlinks. If included in command, it can also only send the accounts with, or without a delegation. Usage: ?sdl list *steemit|steemd *delegated|undelegated listings look similar to this message * update: Updates information for accounts who got their delegations removed by STINC. Usage: ?sdl update * file: Returns a .txt file with appropriate contents and naming for making a pull request to the irredeemables list(https://github.com/steemit/redeemer-irredeemables) Usage: ?sdl file It can only be edited by a small set of users. Listing can be done by anyone.

Relevant commit 1 Relevant commit 2

4. Follow on flags

In order to prevent too many unnecessary comments, I made the follow on flag feature. If another @steemflagrewards abuse hunter already flagged a post, and the abuse fighter who wants to remove even more rewards from the flagged post, you can now use the follow on flags. In order to use this, just comment on the steemflagrewards comment under the first abuse fighters comment with the abuse category in it. Then the bot will not create another comment. Relevant commit Example follow on flag + comment

Small notice: some of these changes are a lot older than 14 days, but I hope they get considered for the review anyways, since I've been on vacation, and couldn't make the bot "script ready" earlier (amos said it wouldn't be that bad with that guideline)
Another notice: due to some git hiccups, the pull request stuff got somewhat messed up, so I recommend to just look at the commit history

Short term todo list
  • setup.py and PyPi listing for easier usage
  • Queuing up any votes if the VP of the @steemflagrewards account is low
  • Update README.md with up-to-date information and more detailed use instructions

GitHub Account

Flugschwein

#utopian-io #development #steemflagrewards #busy #abuse
Payout: 0.000 HBD
Votes: 87
More interactions (upvote, reblog, reply) coming soon.