paper-dynasty-discord/cogs
Cal Corum 943dcc9b74 CLAUDE: Add get_context_user() helper for hybrid command compatibility
Created get_context_user() helper function to safely extract the user from
either Context or Interaction objects. This prevents AttributeError issues
when hybrid commands are invoked as slash commands.

Hybrid commands receive commands.Context (with .author) when invoked with
prefix commands, but discord.Interaction (with .user) when invoked as slash
commands. The helper function handles both cases transparently.

Updated all affected hybrid commands:
- /branding-pd (cogs/players.py, cogs/players_new/team_management.py)
- /pullroster (cogs/players.py, cogs/players_new/team_management.py)
- /newsheet (cogs/economy_new/team_setup.py)
- /lastpack (cogs/economy_new/packs.py)

This follows the same pattern as the owner_only() fix and provides a
consistent, maintainable solution for all hybrid commands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 09:07:09 -06:00
..
economy_new CLAUDE: Add get_context_user() helper for hybrid command compatibility 2025-11-10 09:07:09 -06:00
players_new CLAUDE: Add get_context_user() helper for hybrid command compatibility 2025-11-10 09:07:09 -06:00
admins.py Catchup commit 2025-07-22 09:22:19 -05:00
economy.py S10 Updates + PR Bugfix 2025-11-09 06:12:46 -06:00
gameplay_legacy.py Add responders check to dropdowns 2024-12-27 22:33:25 -06:00
gameplay.py CLAUDE: Fix gauntlet game creation and Event 9 issues 2025-11-09 18:56:38 -06:00
owner.py New sync method 2024-12-18 09:59:39 -06:00
players.py CLAUDE: Add get_context_user() helper for hybrid command compatibility 2025-11-10 09:07:09 -06:00
players.py.backup Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00