create account

Steemflagrewards discord bot - Code rewrite and many new features by flugschwein

View this thread on: hive.blogpeakd.comecency.com
· @flugschwein · (edited)
$54.99
Steemflagrewards discord bot - Code rewrite and many new features
#### Repository
https://github.com/anthonyadavisii/steemflagrewards

![](https://steemitimages.com/DQmTJj2SXdXcYLh3gtsziSEUXH6WP43UG6Ltoq9EZyWjQeb/frpaccount.jpg)

## 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](https://steemit.com/steemflagrewards/@steemflagrewards/steem-flag-rewards-report---8-flagger-post---2018-08-05-2248) 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](https://github.com/holgern/beem), it's superior small brother, who is slowly outgrowing steem-python.
[Relevant commit](https://github.com/anthonyadavisii/steemflagrewards/commit/2855c46d0059dd6b8b1f11d83cca5d7d666c63ef)

##### 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:
![](https://cdn.steemitimages.com/DQmPp6QcrJj3Ye6D3m9igdgbwVEY1dgSvtfZKA2y8DQg1k2/image.png)
[Relevant commit](https://github.com/anthonyadavisii/steemflagrewards/commit/6bbeb7ab25095915ebb3e6109842427144a8c11b)

##### 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`
![](https://cdn.steemitimages.com/DQme7LgXgo17TymnWKJsA3iatSPG3jm3uhQumDmQatt9HSn/image.png)
_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](https://github.com/anthonyadavisii/steemflagrewards/commit/8671a30e96829fb3e563b2d15a49576ed863d254)
[Relevant commit 2](https://github.com/anthonyadavisii/steemflagrewards/commit/8ab6a1343abbf08fe17e9a5082074741fe74e972)

##### 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](https://github.com/anthonyadavisii/steemflagrewards/commit/0318dc9e8901bdd629cb17522a260e70c4445545)
[Example follow on flag + comment](https://steemit.com/food/@sarah.taylor/food-photography#@deliberator/re-steemflagrewards-re-re-sarahtaylor-food-photography-20180806t145829z-20180806t152405506z)

<sup>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)<br>Another notice: due to some git hiccups, the pull request stuff got somewhat messed up, so I recommend to just look at the <a href='https://github.com/anthonyadavisii/steemflagrewards/commits/master'>commit history</a></sup>

##### 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](https://github.com/flugschwein)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 23 others
properties (23)
authorflugschwein
permlinksteemflagrewards-discord-bot-code-rebase-and-many-new-features
categoryutopian-io
json_metadata{"community":"busy","app":"steemit/0.1","format":"markdown","tags":["utopian-io","development","steemflagrewards","busy","abuse"],"users":["steemflagrewards","anthonyadavisii","iamstan"],"links":["https://github.com/anthonyadavisii/steemflagrewards","https://steemit.com/steemflagrewards/@steemflagrewards/steem-flag-rewards-report---8-flagger-post---2018-08-05-2248","https://github.com/holgern/beem","https://github.com/anthonyadavisii/steemflagrewards/commit/2855c46d0059dd6b8b1f11d83cca5d7d666c63ef","https://github.com/anthonyadavisii/steemflagrewards/commit/6bbeb7ab25095915ebb3e6109842427144a8c11b","https://github.com/steemit/redeemer-irredeemables","https://github.com/anthonyadavisii/steemflagrewards/commit/8671a30e96829fb3e563b2d15a49576ed863d254","https://github.com/anthonyadavisii/steemflagrewards/commit/8ab6a1343abbf08fe17e9a5082074741fe74e972","https://github.com/anthonyadavisii/steemflagrewards/commit/0318dc9e8901bdd629cb17522a260e70c4445545","https://steemit.com/food/@sarah.taylor/food-photography#@deliberator/re-steemflagrewards-re-re-sarahtaylor-food-photography-20180806t145829z-20180806t152405506z","https://github.com/anthonyadavisii/steemflagrewards/commits/master","https://github.com/flugschwein"],"image":["https://steemitimages.com/DQmTJj2SXdXcYLh3gtsziSEUXH6WP43UG6Ltoq9EZyWjQeb/frpaccount.jpg","https://cdn.steemitimages.com/DQmPp6QcrJj3Ye6D3m9igdgbwVEY1dgSvtfZKA2y8DQg1k2/image.png","https://cdn.steemitimages.com/DQme7LgXgo17TymnWKJsA3iatSPG3jm3uhQumDmQatt9HSn/image.png"]}
created2018-08-06 16:39:30
last_update2018-08-06 19:43:00
depth0
children10
last_payout2018-08-13 16:39:30
cashout_time1969-12-31 23:59:59
total_payout_value42.535 HBD
curator_payout_value12.459 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,291
author_reputation11,950,112,708,339
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,316,586
net_rshares37,650,470,983,877
author_curate_reward""
vote details (87)
@bid.bot ·
Bid.Bot Upvote
<table>
<tr>
<td>
<center>

<p/>

![bid.bot](https://steemitimages.com/u/bid.bot/avatar/small)
</center>

</td>
<td>

##### Promotion with Instant ROI. For Awesome Bloggers!

</td>
</tr>
</table>

<table>
<tr>
<td>

##### Yeah!

<p><p/>

You just got a boost courtesy of @anthonyadavisii, via @bid.bot and @sneaky-ninja @jerrybanfield. I am the **All-In-One**, Upvoting and Anonymous Flagging BidBot.


</td>
<td>

##### Top Profitability

<p><p/>

I'm able to **calculate and proxy** the most **profitable bids** for the best bidbots out there, so **you don't have to!** Place your bids via <a href="https://bidbot.me">https://bidbot.me</a>.

</td>
</tr>
</table>

properties (22)
authorbid.bot
permlinksteemflagrewards-discord-bot-code-rebase-and-many-new-features-comment
categoryutopian-io
json_metadata{}
created2018-08-09 06:59:06
last_update2018-08-09 06:59:06
depth1
children0
last_payout2018-08-16 06:59:06
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_length666
author_reputation19,745,488,675,947
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,609,448
net_rshares0
@emrebeyler ·
$0.05
Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2332211).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , ,
properties (23)
authoremrebeyler
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180807t065331996z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2332211","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-08-07 06:53:33
last_update2018-08-07 06:53:33
depth1
children0
last_payout2018-08-14 06:53:33
cashout_time1969-12-31 23:59:59
total_payout_value0.041 HBD
curator_payout_value0.011 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length489
author_reputation448,535,049,068,622
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,381,932
net_rshares36,442,078,825
author_curate_reward""
vote details (4)
@gexi ·
$0.06
Gute Aktion, seh aber das gleiche Problem, wie bei steemcleaners, diese wichtige Arbeit wird zu wenig rewarded und damit geht die Motivation gegen 0
👍  , ,
properties (23)
authorgexi
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180807t191204138z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-07 19:12:03
last_update2018-08-07 19:12:03
depth1
children1
last_payout2018-08-14 19:12:03
cashout_time1969-12-31 23:59:59
total_payout_value0.050 HBD
curator_payout_value0.014 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length148
author_reputation2,071,037,581,586
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,442,900
net_rshares45,143,964,230
author_curate_reward""
vote details (3)
@flugschwein ·
$0.05
Wir geben uns genau deshalb Mühe diese Arbeit zu rewarden ;)
👍  , , ,
properties (23)
authorflugschwein
permlinkre-gexi-re-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180807t195931039z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-07 19:59:33
last_update2018-08-07 19:59:33
depth2
children0
last_payout2018-08-14 19:59:33
cashout_time1969-12-31 23:59:59
total_payout_value0.040 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length60
author_reputation11,950,112,708,339
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,447,022
net_rshares32,667,183,905
author_curate_reward""
vote details (4)
@iamstan ·
$0.03
Thanks @flugschwein for all the hard work you do on stemmit.
You are an example of excellence for all to follow.

Yo do great work helping others on @steemcleaners and at @steemflagrewards thanks for your help very much.
I would like to add that after I build the list of SDL accounts I place them in a hackmd.oi file @themarkymark created then he presently moves them to the irredeemables list on github. 

Will there be a way to move the list along with the bot commands?


Danke @flugschwein für all die harte Arbeit an stemmit.
Sie sind ein Beispiel für Exzellenz, dem alle folgen können.

Ihr leistet großartige Arbeit, indem ihr anderen bei @steemcleaners und bei @steemflagrewards für eure Hilfe sehr dankbar seid.
Ich möchte hinzufügen, dass, nachdem ich die Liste der SDL-Konten erstellt habe, ich sie in eine hackmd.oi-Datei @themarkymark einfüge, die er dann zur Zeit in die Liste der nicht einlösbaren Konten auf github verschiebt. 

Wird es eine Möglichkeit geben, die Liste zusammen mit den Bot-Befehlen zu verschieben?
👍  , , , , ,
properties (23)
authoriamstan
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180808t072024729z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["flugschwein","steemcleaners","steemflagrewards","themarkymark"],"app":"steemit/0.1"}
created2018-08-08 07:20:27
last_update2018-08-08 07:20:27
depth1
children0
last_payout2018-08-15 07:20:27
cashout_time1969-12-31 23:59:59
total_payout_value0.025 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,033
author_reputation16,376,108,300,630
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,495,495
net_rshares20,619,731,979
author_curate_reward""
vote details (6)
@infinitelearning ·
finde es echt super, was du machst! Ich muss mich in das ganze mal etwas mehr einlesen, klingt auf jedenfall spannend! :)
properties (22)
authorinfinitelearning
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180810t164453596z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-10 16:44:51
last_update2018-08-10 16:44:51
depth1
children0
last_payout2018-08-17 16:44:51
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_length121
author_reputation19,160,510,937,665
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,774,557
net_rshares0
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by anthonyadavisii from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows.  Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
properties (22)
authorminnowsupport
permlinkre-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180808t030538z
categoryutopian-io
json_metadata"{"app": "beem/0.19.50"}"
created2018-08-08 03:05:36
last_update2018-08-08 03:05:36
depth1
children0
last_payout2018-08-15 03:05:36
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,698
author_reputation148,902,805,319,183
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,477,783
net_rshares0
@scientes ·
Didnt know about beem! thanks! i wanted to implement some features that steem-python wass missing myself and now found them there.
👍  
properties (23)
authorscientes
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180807t081356967z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-07 08:13:57
last_update2018-08-07 08:13:57
depth1
children0
last_payout2018-08-14 08:13:57
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_length130
author_reputation107,331,817,927
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,388,067
net_rshares5,824,420,985
author_curate_reward""
vote details (1)
@sneaky-ninja ·
re-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180808t190506944z
![sneaky-ninja-sword-xs.jpg](https://steemitimages.com/DQmde7XXhkKjmxyqBbBPTwkaiuXXrtQe6qXoWmCDZL1nD2B/sneaky-ninja-sword-xs.jpg)
Sneaky Ninja Attack! You have just been defended with a 13.53% upvote!
I was summoned by @bidbot.credits. I have done their bidding and now I will vanish...

woosh
A portion of the proceeds from your bid was used in support of youarehope and tarc.

[Abuse Policy]( https://steemit.com/steemit/@sneaky-ninja/new-sneaky-ninja-abuse-policy-must-read-for-all-users)
[Rules]( https://steemit.com/steemit/@sneaky-ninja/sneaky-ninja-reminder-of-rules)
[How to use Sneaky Ninja]( https://steemit.com/steemit/@sneaky-ninja/reminder-how-to-use-sneaky-ninja)
[How it works]( https://steemit.com/steemit/@sneaky-ninja/sneaky-ninja-reminder-of-how-he-works-vote-worth-usd160-now)
[Victim of grumpycat?](https://steemit.com/we-resist/@firedream/resistance-started)
properties (22)
authorsneaky-ninja
permlinkre-flugschwein-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180808t190506944z
categoryutopian-io
json_metadata{"app":"postpromoter/2.0.0"}
created2018-08-08 19:05:06
last_update2018-08-08 19:05:06
depth1
children0
last_payout2018-08-15 19:05:06
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_length881
author_reputation6,929,108,306,933
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,557,405
net_rshares0
@utopian-io ·
$0.02
Hey @flugschwein
**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
👍  ,
properties (23)
authorutopian-io
permlinkre-steemflagrewards-discord-bot-code-rebase-and-many-new-features-20180811t162008z
categoryutopian-io
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-11 16:20:09
last_update2018-08-11 16:20:09
depth1
children0
last_payout2018-08-18 16:20:09
cashout_time1969-12-31 23:59:59
total_payout_value0.016 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length303
author_reputation152,955,367,999,756
root_title"Steemflagrewards discord bot - Code rewrite and many new features"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,871,594
net_rshares16,023,679,079
author_curate_reward""
vote details (2)