fix(tty_roles.py): handle role assignment errors#864
Merged
anemoijereja-eden merged 1 commit intomainfrom May 13, 2025
Merged
Conversation
Contributor
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
|
Contributor
There was a problem hiding this comment.
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}") |
Contributor
There was a problem hiding this comment.
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.
anemoijereja-eden
approved these changes
May 13, 2025
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes issue if user is kicked/leaves within 5 seconds
Summary by Sourcery
Bug Fixes: