Repository navigation
Add /audit command - #312
Merged
Merged
Conversation
Zabuzard
requested review from
RealYusufIsmail,
Tais993,
illuminator3,
java-coding-prodigy and
marko-radosavljevic
December 10, 2021 14:03
|
Kudos, SonarCloud Quality Gate passed! |
Zabuzard
enabled auto-merge (rebase)
December 10, 2021 14:14
RealYusufIsmail
suggested changes
Dec 10, 2021
Heatmanofurioso
approved these changes
Dec 10, 2021
RealYusufIsmail
approved these changes
Dec 10, 2021
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.








Overview
This adds the
/audit usercommand, which is basically a migration of Dynos?modlogsand?warningscommands. It displays all moderative actions that have been taken against a user:and
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
ModerationActionsStorecan 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
/auditis 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
Actionenum. Possible, but I first wanted to hear your opinions about this.