Backend for the RaidHub Discord application: it receives Discord interactions over HTTP, checks request signatures, registers slash commands, and proxies the relevant work to the RaidHub API (search, channel subscriptions, and related flows). It is meant to run as a small always-on service (for example behind your ingress), not as something you embed in other apps.
- Copy
.env.exampleto.envand set Discord and RaidHub values there. Use an API base URL this process can actually reach (a cloud-hosted bot cannot callhttp://localhost:8000on your laptop). - Use Python 3.14+, create a virtualenv, then
pip install -e ".[dev]"from this directory. - Run the app, for example:
uvicorn src.main:app --reload --port 8787(use the same interpreter you installed into).
When the RaidHub API runs with production-style auth, configure the API key in .env to match what the API expects (see comments in .env.example).
After changing command definitions, push them to Discord with the sync-discord-commands console script from this package.
- Leave
DISCORD_GUILD_IDunset for global commands (slower to propagate everywhere). - Set
DISCORD_GUILD_IDfor guild commands while iterating (updates show up quickly in that server). - Set
DISCORD_SYNC_DRY_RUN=trueto print the payload without calling Discord.
Logging level is controlled with LOG_LEVEL. You can point SENTRY_DSN (and related SENTRY_* variables) at Sentry for error reporting; see .env.example for the full set.