-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(tty_roles.py): handle role assignment errors #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR enhances the role assignment logic by catching and handling discord.NotFound errors—specifically to detect if a member has left or been kicked before a delayed role assignment—and logs accordingly to avoid silent failures. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @electron271 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
if member.guild.get_member(member.id) is None: | ||
logger.info(f"Member {member} left or got kicked by the server before the role could be assigned.") | ||
return | ||
logger.error(f"Failed to assign role {role.name} to {member}: {error}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider lowering log level for expected NotFound errors
If a missing member is truly unexpected, keep the error level; otherwise (e.g. role deletion or race condition), switch to warning or debug to reduce log noise.
Deploying tux with
|
Latest commit: |
ca39dc6
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b6a1e195.tux-afh.pages.dev |
Branch Preview URL: | https://tty-fix.tux-afh.pages.dev |
fixes issue if user is kicked/leaves within 5 seconds
Summary by Sourcery
Bug Fixes: