Skip to content

aspec-german/discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-bot

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 🎉

Installation

First create a virtualenv:

python3 -m venv .venv
source .venv/bin/activate # bash/zsh
. .venv/bin/activate.fish # fish

Then install the requirements:

pip3 install -r requirements.txt

Usage

Copy env.tmpl to .env and replace xyz with the proper values.
Then run:

python3 bot.py

Docker

docker build -t bot .
docker run --rm -it -v $(pwd):/opt bot # bash/zsh
docker run --rm -it -v (pwd):/opt bot

Development / Contribution

Create 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