Skip to content

Discord Bot that allows users to self-assign color roles.

License

Notifications You must be signed in to change notification settings

EthanC/Spectrum

Repository files navigation

Spectrum

Spectrum is a Discord Bot that allows users to self-assign color roles.

Getting Started

Quick Start: Docker (Recommended)

Important

Discord API credentials for a Bot user are required.

Edit and run this compose.yaml example with docker compose up -d.

services:
  spectrum:
    container_name: Spectrum
    image: ethanchrisp/spectrum:latest
    environment:
      LOG_LEVEL: INFO
      LOG_DISCORD_WEBHOOK_URL: https://discord.com/api/webhooks/XXXXXXXX/XXXXXXXX
      LOG_DISCORD_WEBHOOK_LEVEL: WARNING
      DISCORD_BOT_TOKEN: XXXXXXXX
      DISCORD_SERVER_IDS: 0000000000
    ports:
      - 7732:8080
    volumes:
      - /path/to/spectrum.json:/spectrum/spectrum.json
    restart: unless-stopped

Expose the Spectrum instance publicly over HTTPS on port 7732, then set the Interactions Endpoint URL in the Discord Developer Panel to that address.

Standalone

Note

Spectrum targets Python 3.14 and newer. Compatibility with earlier versions is not guaranteed.

Install Python and the required dependencies with uv:

uv sync

Rename .env.example to .env and configure your environment.

Run Spectrum with uv.

uv run spectrum.py -OO

Expose the Spectrum instance publicly over HTTPS on port 7732, then set the Interactions Endpoint URL in the Discord Developer Panel to that address.

Configuration

All configuration is managed through environment variables on the system hosting the Bot instance.

Environment Variable Description Default
LOG_LEVEL Loguru level of log events to print to the console. INFO
LOG_DISCORD_WEBHOOK_URL Discord Webhook URL to forward log events to. N/A
LOG_DISCORD_WEBHOOK_LEVEL Loguru level of log events to forward to Discord. N/A
STORAGE_PATH Path to where the JSON persistent storage is stored. ./spectrum.json
DISCORD_BOT_TOKEN (Required) Discord API credentials for your Bot user. N/A
DISCORD_SERVER_IDS (Required) Comma-separated list of Discord server IDs to sync commands to. N/A

Disclaimer

Spectrum is not affiliated with or endorsed by Activision or Discord.

All trademarks and assets belong to their respective owners.