A Discord bot that integrates with GitHub Projects to help teams manage and view project tasks directly from Discord.
Hosted via https://github.com/KellisLab/MantisAPI
This bot provides various Discord slash commands to help teams manage their workflow and projects. Key capabilities include:
- GitHub Integration: Seamlessly connect with GitHub Projects and organizational data
- Team Collaboration: Channel-based project management and task coordination
- AI-Powered Tools: Advanced features for productivity and automation
- Real-time Updates: Live data synchronization and notifications
The bot supports multiple slash commands for different functionalities. Use /help in Discord to see all available commands and their usage.
Feature-specific implementation and operator notes live with their packages:
members/README.mddocuments member profiles and the/member importCSV contract.teams/README.mddocuments the persistent team workflow.
uvfor local development (it installs the matching Python version)- Docker only if you prefer container-based development
- .env file provided by @DemonizedCrush
This repository uses Python 3.11 to match the Docker image. With uv
installed, create the local environment and install all dependencies:
uv venv --python 3.11 .venv
uv pip install --python .venv/bin/python -r requirements-dev.txtVS Code automatically uses .venv for Python analysis and terminals. Reload
the VS Code window if it was already open, then start the bot with automatic
restart on Python changes:
./scripts/dev.shYou can also run the VS Code task Run bot (hot reload) from the Command
Palette. Stop the bot with Ctrl+C.
Format the code and automatically fix lint issues with Ruff:
ruff format .
ruff check --fix .- Clone the repository
- Create your
.envfile with the required environment variables - Run with Docker Compose:
docker compose watchDocker Compose starts the bot with the DATABASE_URL from .env. In
production-oriented setups this should point at RDS. The bundled PostgreSQL
service is only for local test databases and stores rows in the named
postgres_data volume across restarts.
Set USER_ROLE_SYNC_ENABLED=false in .env for developer-mode runs that should
not automatically modify Discord roles. docker compose watch syncs .env and
restarts the bot when that value changes.
- Clone the repository
- Install dependencies:
python -m pip install -r requirements.txt- Create your
.envfile with the required environment variables - Run the bot:
python bot.pyDATABASE_URL is the production database URL used by the bot and Alembic
migrations. For RDS, include SSL mode in the URL when required by the instance:
DATABASE_URL=postgresql+psycopg://user:password@your-rds-endpoint.amazonaws.com:5432/mantis?sslmode=requireTeam integration tests do not use DATABASE_URL directly. They set
DATABASE_URL from TEAM_TEST_DATABASE_URL before importing database code, and
default to the local database
postgresql+psycopg://mantis:mantis@localhost:5432/mantis.
To run the local PostgreSQL test database with Docker Compose:
docker compose up -d db
DATABASE_URL=postgresql+psycopg://mantis:mantis@localhost:5432/mantis \
alembic upgrade headApply migrations to the configured DATABASE_URL with:
alembic upgrade headCreate a new migration after changing a SQLModel table with:
alembic revision --autogenerate -m "describe the change"The reusable data-storage layer is in storage.py. Values are JSON objects
addressed by a namespace and key:
from database import get_session
from storage import get_value, set_value
with get_session() as session:
set_value(session, "reminders", "last-run", {"status": "complete"})
record = get_value(session, "reminders", "last-run")Please create a Pull Request for others to review your changes. We have a development bot in the Internal Discord Server. Please ask @DemonizedCrush for the bot token and the developer role in the Discord to test out your changes.