tux icon indicating copy to clipboard operation
tux copied to clipboard

Add flagging functionality for moderation

Open Atmois opened this issue 1 year ago • 1 comments

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

Atmois avatar Sep 18 '24 19:09 Atmois

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
  • Implemented 'flag' and 'unflag' commands
  • Created FlagFlags and UnFlagFlags classes for command flags
  • Added methods to check if a user is flagged
  • Updated case type emojis to include flag and unflag actions
tux/cogs/moderation/flag.py
tux/cogs/moderation/unflag.py
tux/utils/flags.py
tux/cogs/moderation/cases.py
Improved case handling and response system
  • Added 'silent_action' parameter to handle_case_response method
  • Updated case response embeds to properly convey information about DM status
  • Modified when case responses are sent to the logging channel
tux/cogs/moderation/__init__.py
tux/cogs/moderation/ban.py
tux/cogs/moderation/jail.py
tux/cogs/moderation/kick.py
tux/cogs/moderation/snippetban.py
tux/cogs/moderation/snippetunban.py
tux/cogs/moderation/tempban.py
tux/cogs/moderation/unban.py
tux/cogs/moderation/unjail.py
tux/cogs/moderation/untimeout.py
tux/cogs/moderation/warn.py
tux/cogs/moderation/timeout.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on 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.

sourcery-ai[bot] avatar Sep 18 '24 20:09 sourcery-ai[bot]