-
-
Notifications
You must be signed in to change notification settings - Fork 34
Jail/unjail fix #888
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
base: main
Are you sure you want to change the base?
Jail/unjail fix #888
Conversation
Reviewer's GuideThis PR fixes issues in the jail and unjail slash commands by removing the explicit Sequence Diagram: Updated Unjail Process with Atomic Role RestorationsequenceDiagram
actor Moderator
participant Bot
participant DiscordAPI
Moderator->>Bot: /unjail [member, reason]
Bot->>Bot: Identify Jail Role to remove
Bot->>DiscordAPI: remove_roles(member, JailRole, reason)
DiscordAPI-->>Bot: Jail Role removed
Bot->>Bot: Identify member's roles to restore (roles_to_restore)
Bot->>DiscordAPI: add_roles(member, roles_to_restore, reason) [Atomic]
DiscordAPI-->>Bot: Roles restored (all or none)
Bot-->>Moderator: Confirmation of unjailing
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying tux with
|
Latest commit: |
03cdd0c
|
Status: | ✅ Deploy successful! |
Preview URL: | https://933a59a4.tux-afh.pages.dev |
Branch Preview URL: | https://jail-unjail-fix.tux-afh.pages.dev |
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 @RainzDev - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 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.
Description
There was a problem with Tux where the jail command would add and remove the jail role from the member once ran and the unjail command having the similar issue as well. The fix had to do with caching and enabling atomic for
remove_roles
andadd_roles
.Guidelines
My code follows the style guidelines of this project (formatted with Ruff)
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation if needed
My changes generate no new warnings
I have tested this change
Any dependent changes have been merged and published in downstream modules
I have added all appropriate labels to this PR
I have followed all of these guidelines.
How Has This Been Tested? (if applicable)
Ran the jail/unjail slash command from one of Tux dev bots.
Screenshots (if applicable)
N/A
Additional Information
N/A
Summary by Sourcery
Bug Fixes: