Skip to content

Add /audit command - #312

Merged
Zabuzard merged 2 commits into
developfrom
feature/add_audit_command
Dec 10, 2021
Merged

Zabuzard merged 2 commits into
developfrom
feature/add_audit_command

Conversation

@Zabuzard

@Zabuzard Zabuzard commented Dec 10, 2021 •

Copy link
Copy Markdown
Member

Overview

This adds the /audit user command, which is basically a migration of Dynos ?modlogs and ?warnings commands. It displays all moderative actions that have been taken against a user:

empty case

and

base use case

Closes #301 .

The primary use case for this is to review warnings (shipped by #249 ).

The actions are currently displayed chronologically ascending. And there is a short summary in the beginning. The "description" text in the embeds is the reason of the action (sorry, I was too lazy to type something nice during testing 😆 ).

Notes

Only actions known to the ModerationActionsStore can be retrieved and displayed. For now, this means that only actions issued by our own commands are shown (/ban, /kick). In the future however, we could also think about adding a routine/listener that populates our store with actions done through the Discord UI or other bots.

The cool thing about how /audit is designed now (being solely based on the store (database table)) is that it is fully forward compatible with commands added in the future. In particular /mute, /unmute (#252 ) and /warn (#249 ), as well as temporary actions like temporary bans or mutes (#267 ).

In order to use the command, one needs the heavyModerationRole (Moderator) and the bot, as well as the user need enough permission to interact with the target user.

Future ideas

  • The summary in the beginning can also be used to give the warning count when Migrate /warn command #249 is added.
  • I was thinking about adding different colors for the embeds depending on type (red for BAN, green for MUTE, yellow for warning, ...), but then I would need to edit that Action enum. Possible, but I first wanted to hear your opinions about this.

@Zabuzard Zabuzard added new command Add a new command or group of commands to the bot priority: major labels Dec 10, 2021
@Zabuzard Zabuzard added this to the Migrate existing commands milestone Dec 10, 2021
@Zabuzard
Zabuzard requested review from a team as code owners December 10, 2021 14:03
@Zabuzard Zabuzard self-assigned this Dec 10, 2021
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard
Zabuzard enabled auto-merge (rebase) December 10, 2021 14:14
@Zabuzard
Zabuzard merged commit 1a87811 into develop Dec 10, 2021
@RealYusufIsmail
RealYusufIsmail deleted the feature/add_audit_command branch December 10, 2021 16:56
@Zabuzard Zabuzard mentioned this pull request Dec 14, 2021
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new command Add a new command or group of commands to the bot priority: major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an Audit Command

3 participants