Add flagging functionality for moderation
Description
Allows moderators to flag users who may be of concern, adding checks for if user is already flagged or not for each command. To be improved upon with better features for flagging in the future see #555 for more info. Emotes for flag and unflag need to be added aswell as they have just been given tempoary emojis.
PR also adds the functionality for cases to not be sent to a logging channel, improves when the handle_case_response is called for maintainability and improving the codebase and updates case embeds to properly convey information about a DM not being sent or a silent action.
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
-
[X] I have followed all of these guidelines.
How Has This Been Tested? (if applicable)
tested in tux dev
Screenshots (if applicable)
n/a
Additional Information
n/a
Reviewer's Guide by Sourcery
This pull request implements a new flagging functionality for moderation purposes, allowing moderators to flag and unflag users of concern. It also includes improvements to the case handling system, particularly in how case responses are handled and displayed.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Added new flagging functionality for moderation |
|
tux/cogs/moderation/flag.pytux/cogs/moderation/unflag.pytux/utils/flags.pytux/cogs/moderation/cases.py |
| Improved case handling and response system |
|
tux/cogs/moderation/__init__.pytux/cogs/moderation/ban.pytux/cogs/moderation/jail.pytux/cogs/moderation/kick.pytux/cogs/moderation/snippetban.pytux/cogs/moderation/snippetunban.pytux/cogs/moderation/tempban.pytux/cogs/moderation/unban.pytux/cogs/moderation/unjail.pytux/cogs/moderation/untimeout.pytux/cogs/moderation/warn.pytux/cogs/moderation/timeout.py |
Tips
- Trigger a new Sourcery review by commenting
@sourcery-ai reviewon the pull request. - Continue your discussion with Sourcery by replying directly to review comments.
- You can change your review settings at any time by accessing your dashboard:
- Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
- Change the review language;
- You can always contact us if you have any questions or feedback.