Skip to content

Fix user commands types#738

Merged
MattyTheHacker merged 7 commits intomainfrom
fix-user-commands-types
Mar 24, 2026
Merged

Fix user commands types#738
MattyTheHacker merged 7 commits intomainfrom
fix-user-commands-types

Conversation

@MattyTheHacker
Copy link
Member

Rectifies the issue identified in #736 for all other user_commands.

Must be merged after #736

@MattyTheHacker MattyTheHacker self-assigned this Mar 23, 2026
@MattyTheHacker MattyTheHacker added the bug Something isn't working label Mar 23, 2026
Copilot AI review requested due to automatic review settings March 23, 2026 20:10
@MattyTheHacker MattyTheHacker added the sync Request bots to automatically keep this PR up to date with it's base branch label Mar 23, 2026
@MattyTheHacker MattyTheHacker enabled auto-merge (squash) March 23, 2026 20:10
@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix type/behavior mismatches in Discord user context commands where the selected “member” argument can be a discord.User (e.g., when the target has left the server), aligning with the issue described in #736 and extending the approach to other commands.

Changes:

  • Update user-context-command parameter types to accept discord.Member | discord.User.
  • Refactor induction and applicant flows to pass user IDs into internal helpers and re-resolve to discord.Member via the main guild before accessing member-only fields (like .roles).
  • Simplify the “make applicant from message author” path by reusing the shared helper logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cogs/strike.py Expands strike context-command typings to allow discord.User (but currently still has a crash path when the target isn’t a guild member).
cogs/make_applicant.py Changes internal helper to accept an ID and validates membership via main_guild.get_member(...) before role operations.
cogs/induct.py Changes internal helper to accept an ID and validates membership via main_guild.get_member(...) before role operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MattyTheHacker MattyTheHacker merged commit 4ef6f86 into main Mar 24, 2026
13 checks passed
@MattyTheHacker MattyTheHacker deleted the fix-user-commands-types branch March 24, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sync Request bots to automatically keep this PR up to date with it's base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants