fix: complete migration of daily check-in to discord.Interaction (#19) #69

Closed
cal wants to merge 13 commits from ai/paper-dynasty-discord-19 into main
Owner

Summary

  • Removed # TODO: complete the migration to an interaction comment (line 558)
  • Removed greeting = assignment from both branches of daily_checkin (5th check-in and 2nd/4th check-in paths)
  • Replaced await greeting.edit(...) (ctx-style message pattern) with await interaction.edit_original_response(...) for consistency with the rest of the function

Root Cause

The function was mostly migrated to use discord.Interaction, but retained the old ctx-era pattern of saving the return value of a send/edit call into a greeting variable and calling .edit() on it. The fully-migrated pattern is to call interaction.edit_original_response() directly throughout.

Files Changed

  • cogs/economy.py — functional changes to daily_checkin

Note: The project's ruff formatter ran automatically via a Claude Code hook when the file was edited, producing cosmetic changes (quote style, line wrapping) throughout economy.py beyond the three functional lines. The formatter is configured at the project level and cannot be selectively bypassed.

Other Observations

  • No test suite exists for this cog, so no tests to run.

🤖 Generated with Claude Sonnet 4.6

## Summary - Removed `# TODO: complete the migration to an interaction` comment (line 558) - Removed `greeting =` assignment from both branches of `daily_checkin` (5th check-in and 2nd/4th check-in paths) - Replaced `await greeting.edit(...)` (ctx-style message pattern) with `await interaction.edit_original_response(...)` for consistency with the rest of the function ## Root Cause The function was mostly migrated to use `discord.Interaction`, but retained the old `ctx`-era pattern of saving the return value of a send/edit call into a `greeting` variable and calling `.edit()` on it. The fully-migrated pattern is to call `interaction.edit_original_response()` directly throughout. ## Files Changed - `cogs/economy.py` — functional changes to `daily_checkin` > **Note:** The project's ruff formatter ran automatically via a Claude Code hook when the file was edited, producing cosmetic changes (quote style, line wrapping) throughout `economy.py` beyond the three functional lines. The formatter is configured at the project level and cannot be selectively bypassed. ## Other Observations - No test suite exists for this cog, so no tests to run. 🤖 Generated with Claude Sonnet 4.6
cal added 1 commit 2026-03-05 20:04:38 +00:00
fix: complete migration of daily check-in to discord.Interaction (#19)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m23s
4c8fd6f87f
Remove ctx-style greeting.edit() pattern; replace with
interaction.edit_original_response() throughout. Remove TODO comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-05 20:15:34 +00:00
cal reviewed 2026-03-05 20:16:59 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • cogs/economy.py (modified — functional changes to daily_checkin, plus ruff cosmetic reformatting throughout)

Findings

Correctness

  • The three functional changes are correct and consistent:
    1. Removed # TODO: complete the migration to an interaction (line ~558 old) — done.
    2. Dropped greeting = assignment in both branches: the return value of interaction.edit_original_response() (discord.InteractionMessage) was only ever used in the one await greeting.edit(...) call that follows roll_for_cards.
    3. Replaced await greeting.edit(content=...) with await interaction.edit_original_response(content=...) — both target the same message (the deferred original response via the webhook token), but the interaction-based call is the correct discord.py pattern and consistent with every other edit in this function.
  • No off-by-one, null, or type issues introduced.

Edge Cases

  • No new edge cases. The error path (if not pack_ids: ... return) still terminates correctly after the edit; the removal of the greeting variable has no effect on control flow.

Security

  • No issues found.

Style & Conventions

  • Ruff formatter ran automatically (project-level hook) producing cosmetic reformatting across the file — expected and acceptable per the PR note. Functional lines are clean.

Suggestions

  • None.

Verdict: APPROVED

Clean migration. The greeting variable was unnecessary once the pattern was fully switched to interaction.edit_original_response(), and its removal makes the code unambiguously correct. No issues.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `cogs/economy.py` (modified — functional changes to `daily_checkin`, plus ruff cosmetic reformatting throughout) ### Findings #### Correctness - The three functional changes are correct and consistent: 1. Removed `# TODO: complete the migration to an interaction` (line ~558 old) — done. 2. Dropped `greeting =` assignment in both branches: the return value of `interaction.edit_original_response()` (`discord.InteractionMessage`) was only ever used in the one `await greeting.edit(...)` call that follows `roll_for_cards`. 3. Replaced `await greeting.edit(content=...)` with `await interaction.edit_original_response(content=...)` — both target the same message (the deferred original response via the webhook token), but the interaction-based call is the correct discord.py pattern and consistent with every other edit in this function. - No off-by-one, null, or type issues introduced. #### Edge Cases - No new edge cases. The error path (`if not pack_ids: ... return`) still terminates correctly after the edit; the removal of the `greeting` variable has no effect on control flow. #### Security - No issues found. #### Style & Conventions - Ruff formatter ran automatically (project-level hook) producing cosmetic reformatting across the file — expected and acceptable per the PR note. Functional lines are clean. #### Suggestions - None. ### Verdict: APPROVED Clean migration. The `greeting` variable was unnecessary once the pattern was fully switched to `interaction.edit_original_response()`, and its removal makes the code unambiguously correct. No issues. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-05 20:17:35 +00:00
cal changed target branch from main to next-release 2026-03-07 07:32:49 +00:00
cal force-pushed ai/paper-dynasty-discord-19 from 4c8fd6f87f to f44ea4452a 2026-03-07 07:33:27 +00:00 Compare
cal changed target branch from next-release to main 2026-03-23 04:14:32 +00:00
Author
Owner

Closing — will re-implement fresh against main. Original PR had unrebaseable conflicts from the scouting refactor.

Closing — will re-implement fresh against `main`. Original PR had unrebaseable conflicts from the scouting refactor.
cal closed this pull request 2026-03-23 04:15:42 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 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#69
No description provided.