This is a small bot for our discord server 🤖
The main purpose for this bot is to replace the Invite-Role
Bot, since it was down more than it was up - but we also
wanted to use the same functionality: adding a role to a member
according to an invite (new user uses invite xyz and gets role foo,
another user joins with invite abc and gets role bar).
Unfortunately this is not yet implemented in the Discord API and
a bug report/feature request for this is already over 2 years
old.
That's why there is (of course) a catch ...
Nevertheless and since it's a good excuse to learn and use python, have fun with this bot 🎉
First create a virtualenv:
python3 -m venv .venv
source .venv/bin/activate # bash/zsh
. .venv/bin/activate.fish # fishThen install the requirements:
pip3 install -r requirements.txtCopy env.tmpl to .env and replace xyz with the proper values.
Then run:
python3 bot.pydocker build -t bot .
docker run --rm -it -v $(pwd):/opt bot # bash/zsh
docker run --rm -it -v (pwd):/opt botCreate a virtualenv and install the requirements as explained in Installation above.
Happy coding! 🎉
If you're done, use pip3 freeze to regenerate the
requirements.txt and create a merge request 😉
pip3 freeze >requirements.txt