Deutschbot - A discord and curation bot for local steemit communities

in utopian-io •  2 years ago  (edited)

Deutschbot is originally designed for Deutsch community. But it can be used in other local communities at Steemit.

Bot basically follows pre-defined trusted curator accounts at the steem network and constantly check their upvotes and upvotes the post itself.

Features

It has two main parts.

Discord Bot
  • add/remove trusted curators
  • add/remove Steemit accounts to/from the blacklist
  • set/get threshold for the basic score algorithm. (Every post has a score. If the score is greater than the threshold, the bot will upvote.)
Transaction Listener

Bot also has a separate transaction listener process, where it listens to curators' vote actions. If there is a post voted by trusted curators and qualified to get an upvote from the bot, it will upvote it.

After upvoting, it will post relevant information to Discord . (Post URL, related curators, voting weight. etc.)

Technology Stack

Bot only need Python3.6 and greater, and a handful of python packages listed on requirements.txt.

Installation

Make sure you have created a virtual environment with python3.6 venv. It's not required for the bot to work, however, it's highly suggested.

$ git clone https://github.com/emre/deutschbot.git
$ cd deutschbot
$ pip install -r requirements.txt
$ cd communitybot
$ vim settings.py # edit accordingly

Running

Discord Bot

Make sure you have edited

  • BOT_TOKEN
  • DB_CONNECTION_URI (Compatible w/ databases dataset supports.

in the settings.py

To run it:

$ python deutschbot.py --run discordbot

Bot commands

$help - Display this help message.
$blacklist - Blacklists a user, or removes them from the blacklist; Usage: $blacklist add username or $blacklist remove username
$curators - Puts users in the list of curators, or removes them; Usage: $curators add username or $curators remove username
$threshold - Regulate the threshold for the bot. $threshold set 100 to set it or $threshold get to current value. to trigger. 100 = 1% VP

Adding authorized users to bot

This can be done via command line.

$ python deutschbot.py --add-discord-user emre#9263

Make sure you include the discord ID.

2. Curator Bot

Running

First, make you sure you have edited:

  • BOT_ACCOUNT
  • BOT_POSTING_KEY
  • TAGS
  • HOOKS

in the settings.py.

$ python deutschbot.py --run curate

This will start listening transactions on the network. If trusted curator votes on something, bot will calculate a score and if the score is greater then the threshold, it will upvote the post.

After upvoting, it will also post to discord about it.

Starting from a specific block

By default, curator bot will start listening from the last block generated. If you need to start it from a
specific block height, you should run the bot as:

$python deutschbot.py  --run curate --start-block 12312333

Feel free to use it for your local community and let me know if you have any issues or feature ideas. Also, See @felixxx's post to find out how the project was born.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

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

Hey @howo, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Very nice, love to see it in Action!

Great idea. Great contribution. Thanks.

Very good Code👍
Its working great :)

Thanks for the bot ... would be extremely helpful, however i can't seem to get it to work.
Screen Shot 2018-02-07 at 2.01.25 PM.png

Please follow the instructions. It seems you have missed the step:

$ pip install -r requirements.txt

Edit: also, if you're not working on a virtual python3 environments, you should follow felixxx's advise. :)

When i run the command .. this error shows up. btw .. how do you obtain DB_CONNECTION_URI

Screen Shot 2018-02-07 at 4.35.21 PM.png

If you point to a non existing db, it will automatically create one.
For a real easy solution, you could just put:

DB_CONNECTION_URI = 'sqlite:///./communitybot.db'

It will create the db right in the folder, you started the script from.

Have you tried using pip3instead of pip and python3 instead of python ?

Hallo @felixxx , selbes Problem hier :

$ pip3 install -r requirements.txt

Requirement already satisfied: dataset in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dataset-1.0.5-py3.6.egg (from -r requirements.txt (line 1))
Collecting requests (from -r requirements.txt (line 2))
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting steem (from -r requirements.txt (line 3))
  Using cached steem-0.18.103.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/37/d4tfn2s978x1kx2vldptk2ph0000gn/T/pip-build-qdfp8mwc/steem/setup.py", line 8, in <module>
        import package_meta # this is a simple tool for loading metadata from Pipfile and other places
      File "/private/var/folders/37/d4tfn2s978x1kx2vldptk2ph0000gn/T/pip-build-qdfp8mwc/steem/package_meta.py", line 10, in <module>
        from setuptools.config import read_configuration
    ModuleNotFoundError: No module named 'setuptools.config'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/37/d4tfn2s978x1kx2vldptk2ph0000gn/T/pip-build-qdfp8mwc/steem/

ich hab das schon mit pip3 und pip versucht, das Modul setuptools ist eigentlich auch da. Oder hab ich da noch ein mySQL Problem ?

Ich bin leider komplett Noob

Requirement already satisfied:

sieht doch gut aus ...

Hey @emrebeyler I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

This is cool! I should actually use and adapt it for the #french #fr community.