chore: add .env.example with placeholder values #135

Merged
cal merged 2 commits from chore/add-env-example into main 2026-04-01 18:02:18 +00:00
Owner

Summary

  • Add .env.example documenting all environment variables required to run the Discord bot
  • Covers: BOT_TOKEN, GUILD_ID, SCOREBOARD_CHANNEL, API_TOKEN, DATABASE, LOG_LEVEL, PYTHONHASHSEED, DB_USERNAME, DB_PASSWORD, DB_URL, DB_NAME, RESTART_WEBHOOK_URL
  • All values are placeholders — no real credentials included

Context

The bot relies on several env vars spread across paperdynasty.py, api_calls.py, in_game/gameplay_models.py, notify_restart.py, and cogs. This file consolidates them so contributors know exactly what to configure without digging through source.

References paper-dynasty-database#9

## Summary - Add `.env.example` documenting all environment variables required to run the Discord bot - Covers: `BOT_TOKEN`, `GUILD_ID`, `SCOREBOARD_CHANNEL`, `API_TOKEN`, `DATABASE`, `LOG_LEVEL`, `PYTHONHASHSEED`, `DB_USERNAME`, `DB_PASSWORD`, `DB_URL`, `DB_NAME`, `RESTART_WEBHOOK_URL` - All values are placeholders — no real credentials included ## Context The bot relies on several env vars spread across `paperdynasty.py`, `api_calls.py`, `in_game/gameplay_models.py`, `notify_restart.py`, and cogs. This file consolidates them so contributors know exactly what to configure without digging through source. References paper-dynasty-database#9
cal added 2 commits 2026-04-01 17:00:18 +00:00
Port the Check-In Player pack fix from the hotfix branch to the legacy
economy.py cog (which production currently loads instead of economy_new).

- Filter auto-open pack types from the manual open-packs menu
- Add pretty_name fallback for hyphenated pack type names
- Add ruff noqa for pre-existing star import warnings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chore: add .env.example with placeholder values
All checks were successful
Ruff Lint / lint (pull_request) Successful in 29s
f704b09933
Document all required environment variables for running the Discord bot,
including bot token, API credentials, database config, and webhook URL.

References paper-dynasty-database#9
Claude added the
ai-reviewing
label 2026-04-01 17:15:48 +00:00
Claude reviewed 2026-04-01 17:17:41 +00:00
Claude left a comment
Collaborator

AI Code Review

Files Reviewed

  • .env.example (added)
  • cogs/economy.py (modified)

Findings

Correctness

  • .env.example covers all env vars claimed in the PR body. All values are placeholders — no real credentials. .env is already in .gitignore (line 105), so the .env.example workflow is sound.
  • AUTO_OPEN_TYPES filter in the packs loop correctly continues before p_group is set, so Check-In Player packs never enter p_data. The p_count counter is also unaffected, which is correct.
  • The else branch added to the pretty_name display loop (pretty_name = key) is a valid defensive fallback for pack types whose group key has a hyphen but contains neither "Team" nor "Cardset". The comment example ("Check-In Player") is slightly misleading because those packs are already filtered out upstream — but the branch itself is not wrong.

Security

  • No issues. All .env.example values are obvious placeholders. The RESTART_WEBHOOK_URL placeholder uses the correct Discord webhook URL structure.

Style & Conventions

  • PR scope mismatch: cogs/economy.py has functional pack-filtering changes that are not mentioned in the PR title or body. The title says "chore: add .env.example" but this PR also fixes open-packs menu behavior (filtering auto-open pack types). These changes are correct but belong in a separate PR with a proper description, or the PR title/body should be updated to cover them.
  • Redundant noqa comment: # ruff: noqa: F403, F405 added at the top of economy.py is redundant — PR #109 already covers cogs/** for F403/F405 in ruff.toml per-file-ignores. The directive is harmless but unnecessary.
  • LOCAL vs module-level constant: AUTO_OPEN_TYPES = {"Check-In Player"} is defined inside the function body. For a set that conceptually describes a configuration policy, a module-level constant would be cleaner and more discoverable, consistent with how SCOUT_TOKEN_COST is defined in helpers/scouting.py. Not a blocker.

Suggestions

  • Update the PR title/body to reflect the economy.py changes (e.g. "chore: add .env.example; fix: filter auto-open pack types from open-packs menu"). As-is, the functional fix is invisible in the PR history.
  • Consider promoting AUTO_OPEN_TYPES to module level.
  • Remove the # ruff: noqa line — ruff.toml already handles it.

Verdict: COMMENT

The .env.example is clean and correct. The economy.py changes are functionally sound — Check-In Player packs are properly filtered before entering the grouping and display logic. No blocking issues. The main concern is the PR title/body mismatch: a functional fix is buried in a "chore" PR with no description of the code change.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `.env.example` (added) - `cogs/economy.py` (modified) ### Findings #### Correctness - `.env.example` covers all env vars claimed in the PR body. All values are placeholders — no real credentials. `.env` is already in `.gitignore` (line 105), so the `.env.example` workflow is sound. - `AUTO_OPEN_TYPES` filter in the packs loop correctly `continue`s before `p_group` is set, so Check-In Player packs never enter `p_data`. The `p_count` counter is also unaffected, which is correct. - The `else` branch added to the pretty_name display loop (`pretty_name = key`) is a valid defensive fallback for pack types whose group key has a hyphen but contains neither "Team" nor "Cardset". The comment example ("Check-In Player") is slightly misleading because those packs are already filtered out upstream — but the branch itself is not wrong. #### Security - No issues. All `.env.example` values are obvious placeholders. The `RESTART_WEBHOOK_URL` placeholder uses the correct Discord webhook URL structure. #### Style & Conventions - **PR scope mismatch**: `cogs/economy.py` has functional pack-filtering changes that are not mentioned in the PR title or body. The title says "chore: add .env.example" but this PR also fixes open-packs menu behavior (filtering auto-open pack types). These changes are correct but belong in a separate PR with a proper description, or the PR title/body should be updated to cover them. - **Redundant noqa comment**: `# ruff: noqa: F403, F405` added at the top of `economy.py` is redundant — PR #109 already covers `cogs/**` for F403/F405 in `ruff.toml` per-file-ignores. The directive is harmless but unnecessary. - **LOCAL vs module-level constant**: `AUTO_OPEN_TYPES = {"Check-In Player"}` is defined inside the function body. For a set that conceptually describes a configuration policy, a module-level constant would be cleaner and more discoverable, consistent with how `SCOUT_TOKEN_COST` is defined in `helpers/scouting.py`. Not a blocker. #### Suggestions - Update the PR title/body to reflect the economy.py changes (e.g. "chore: add .env.example; fix: filter auto-open pack types from open-packs menu"). As-is, the functional fix is invisible in the PR history. - Consider promoting `AUTO_OPEN_TYPES` to module level. - Remove the `# ruff: noqa` line — ruff.toml already handles it. ### Verdict: COMMENT The `.env.example` is clean and correct. The economy.py changes are functionally sound — Check-In Player packs are properly filtered before entering the grouping and display logic. No blocking issues. The main concern is the PR title/body mismatch: a functional fix is buried in a "chore" PR with no description of the code change. --- *Automated review by Claude PR Reviewer*
Claude added
ai-reviewed
and removed
ai-reviewing
labels 2026-04-01 17:17:58 +00:00
Claude approved these changes 2026-04-01 18:02:11 +00:00
Dismissed
Claude left a comment
Collaborator

Approved via pd-pr

Approved via pd-pr
Claude approved these changes 2026-04-01 18:02:16 +00:00
Claude left a comment
Collaborator

Approved via pd-pr

Approved via pd-pr
cal merged commit ff768c95f5 into main 2026-04-01 18:02:18 +00:00
cal deleted branch chore/add-env-example 2026-04-01 18:02:18 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#135
No description provided.