The official bot for the Gurkult — an open source community with the aim of bringing people together.
If you want to contribute, report a problem, add or suggest a new fix or feature, you can open a new issue. The issue should be accepted and discussed before starting to work on the feature. See Dev Installation to know how to start working on said feature.
To get a token, go to Discord Developer Portal. Create an application and add a bot.
git clone https://github.com/gurkult/gurkbot.git
or git clone git@github.com:gurkult/gurkbot.git
.gh repo clone gurkult/gurkbot
.Then navigate to the directory cd gurkbot/
git checkout -b <name of new local branch> main
or git switch -c <name of new local branch> main
. Make sure the new branch name is related to the feature or the fix you have in mind.Create a .env
file in the project root folder.
Copy the contents from .env-example
file into your .env
file and fill up the fields with your bot token and server details.
Pre-requisites
Running and stopping the project
# Build image and start project
# This will start both the Postgres database and the bot.
# Running this the first time will build the image.
docker-compose up --build
# Start/create the postgres database and the bot containers.
docker-compose up
# Use -d flag for detached mode
# This will free the terminal for other uses.
docker-compose up -d
# Stop project
# Use ctrl+C if not in detached mode
docker-compose stop
# Stop and remove containers.
docker-compose down
# Use -v or --volumes flag to remove volumes
docker-compose down --volumes
# Alternativily, `docker-compose` can be
# replaced with `docker compose` (without the hyphen).
Running only database with docker
docker-compose up postgres
Running only bot with docker
docker-compose up gurkbot --no-deps
Prerequisites
Database setup
psql -U postgres -d postgres
CREATE USER gurkbotdb WITH SUPERUSER PASSWORD 'gurkbotdb';
CREATE DATABASE gurkbot WITH OWNER gurkbotdb;
Add DATABASE_URL
variable to .env
file.
DATABASE_URL = postgres://gurkbotdb:gurkbotdb@localhost:5432/gurkbot
postgres://<username>:<password>@<host>:<port>/<database>
port
, username
, password
or database
during installation or in psql, reflect those changes in the DATABASE_URL
.localhost
unless you want to connect to a database which is not hosted on your machine.Command to run the bot: poetry run task bot
Commands to remember:
# Installs the pre-commit git hook.
poetry run task precommit
# Formats the project with black.
poetry run task format
# Runs pre-commit across the project, formatting and linting files.
poetry run task lint
# Runs the discord bot.
poetry run task bot