No description
  • Python 99.6%
  • Dockerfile 0.4%
Find a file
gdh e9b35c3664
All checks were successful
Deploy / deploy (push) Successful in 2m18s
feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 18:49:42 +02:00
.forgejo/workflows feat: add ping/compare, autocomplete, pagination + hardening — bump to v0.5.0 2026-06-14 15:12:00 +02:00
.gitlab/issue_templates feat: bootstrap standalone bodega discord bot 2026-03-11 18:11:21 +01:00
.vscode feat: bootstrap standalone bodega discord bot 2026-03-11 18:11:21 +01:00
docs feat(chart): add weekly/monthly intervals and company-name title — bump to v0.6.0 2026-06-14 15:31:42 +02:00
src/bodega_discord_bot feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0 2026-06-23 18:49:42 +02:00
tests/unit feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0 2026-06-23 18:49:42 +02:00
.env.example feat: bootstrap standalone bodega discord bot 2026-03-11 18:11:21 +01:00
.gitignore feat: bootstrap standalone bodega discord bot 2026-03-11 18:11:21 +01:00
CHANGELOG.md feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0 2026-06-23 18:49:42 +02:00
CLAUDE.md feat: add ping/compare, autocomplete, pagination + hardening — bump to v0.5.0 2026-06-14 15:12:00 +02:00
docker-compose.yml chore(ci): fix pipeline 2026-03-12 13:22:03 +01:00
Dockerfile feat: add ping/compare, autocomplete, pagination + hardening — bump to v0.5.0 2026-06-14 15:12:00 +02:00
pyproject.toml feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0 2026-06-23 18:49:42 +02:00
README.md feat(chart): add weekly/monthly intervals and company-name title — bump to v0.6.0 2026-06-14 15:31:42 +02:00
uv.lock feat(chart): raise default bars to 90, soften candle colors — bump to v0.8.0 2026-06-23 18:49:42 +02:00

Bodega Discord Bot

Standalone Discord bot for querying non-authenticated Bodega market data endpoints.

Authenticated Bodega flows, direct database access, and monorepo runtime coupling are out of scope.

Commands

Run /help in Discord to see the live list. The bot provides the following slash commands, grouped by category. Symbol arguments offer live autocomplete (powered by /search), and long result lists (/search, /scores, /top) are navigable with Prev/Next buttons.

Price & Market Data

  • /latest <symbol> — latest daily bar (OHLCV)
  • /price <symbol> [n] — recent daily bars (130, default 5)
  • /chart <symbol> [n] [interval] — candlestick chart image (290 bars, default 30; interval daily/weekly/monthly, default daily)
  • /compare <symbol_a> <symbol_b> — compare the latest bars of two symbols

Asset Information

  • /asset <symbol> — detailed asset metadata
  • /search <query> — search by name or ticker fragment

Fundamentals & Financials

  • /financials <symbol> — annual financial statement
  • /earnings <symbol> — historical earnings events
  • /estimates <symbol> — analyst EPS & revenue estimates

Earnings & Surprises

  • /surprises <symbol> [n] — EPS surprises (110, default 5)

Ratings & Targets

  • /rating <symbol> — analyst rating & price target
  • /targets <symbol> [n] — price target history (110, default 5)

Analytics & Performance

  • /score <symbol> — asset analytics score breakdown
  • /scores [sector] [exchange] [limit] — top scores leaderboard (125, default 10)
  • /rolling <symbol> [window] — rolling volatility & returns (5252 days, default 20)
  • /correlation <symbols> — correlation matrix (25 comma-separated symbols)
  • /range <symbol> — support/resistance levels & status
  • /top [asset_type] [sector] [limit] — top performers (125, default 10)

News & Macro

  • /news <symbol> [days] — recent news (130 days, default 7)
  • /macro <series_id> [n] — macro indicator history (e.g. CPI, GDP; 112 points, default 6)
  • /macro-list — list available macro series

Utility

  • /help — show the full command list
  • /ping — check the bot's gateway latency

Requirements

  • Python 3.12+
  • A Discord bot token with application command permissions
  • Network access to the Bodega API base URL

The bot depends on discord.py, httpx, pydantic/pydantic-settings, structlog, and mplfinance + pandas (used to render /chart candlestick images). Dependencies are managed with uv (see pyproject.toml).

Configuration

Required environment variables:

  • DISCORD_BOT_TOKEN
  • BODEGA_API_BASE_URL

Optional environment variables:

  • BODEGA_API_TIMEOUT_SECONDS default 8
  • BODEGA_API_RETRIES default 2
  • DISCORD_GUILD_IDS comma-separated guild IDs for fast development sync
  • LOG_LEVEL default INFO

See .env.example.

Local Development

uv sync --extra dev
cp .env.example .env
uv run python -m bodega_discord_bot

Useful commands:

uv run ruff check .
uv run mypy src
uv run pytest tests/unit
uv run python -m bodega_discord_bot

Docker

docker compose up --build

The container runs as an unprivileged user (appuser).

The repository uses uv for dependency resolution, locking, and local execution.

Deployment

Deployment is handled by Forgejo Actions (.forgejo/workflows/deploy.yml). On pushes to main it rsyncs the code to the server, builds the Docker image, and restarts the drocsid container.

Required CI secrets:

  • SSH_PRIVATE_KEY — deploy SSH key
  • SSH_KNOWN_HOSTS — server host key(s); populate via ssh-keyscan <DEPLOY_HOST> (host-key verification is enforced)
  • ENV_FILE — contents written to .env on the server
  • DEPLOY_USER, DEPLOY_HOST, DEPLOY_PATH — deploy target

Docs

  • docs/bodega-api-contract.md
  • docs/runbook.md
  • docs/issue-checklist.md