User command enhancements#637
Merged
Merged
Conversation
#628 #339 This commit introduces several changes to the output of the `!user` command for moderation staff. The output for regular users has not changed. Changes: - When issued in a moderation channel, the infraction count of the user will now be broken down by type as described in #339. This allows moderators to get a quicker overview of someone's history by providing more information. The command will display the total number of infractions per type, with the number of active infractions in parentheses behind it if there are any. This change also means that there no longer a need for the `hidden` parameter: When issued in a moderation channel, hidden infractions are included by default; when issued outside of a mod channel, the command will be equal to what a regular user would get. In addition to broken-down infraction info, the command now also shows information about the nominations of a user when it's issued inside of a moderation channel. - The code has been refactored to smaller units that take care of a single action to make unit testing easier. I have included tests that cover the command and all of the new helper methods. Tests for the other methods/commands in the cog will be added in the specific issue calling for tests for this cog (#581) This commit closes #628 and closes #339
082e499 to
6e57f41
Compare
sco1
approved these changes
Nov 3, 2019
ikuyarihS
approved these changes
Nov 4, 2019
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.
Abstract
This pull request introduces several changes to the output of the
!usercommand for moderation staff. The output for regular users has not changed. In addition, the code has been refactored to allow for easier unit tests and has been fully tested.Changes
Since both hidden and non-hidden infractions are now included by default when the command was issued in a moderation channel, there is no longer a need for a
hiddenparameter for the command. It has been removed.In addition to broken-down infraction counts, the command now also shows information about the nominations of a user when it's issued inside of a moderation channel:
bot/cogs/information.py#581).Screenshots
Command issues outside of moderation channels
Inside moderation channel, no infractions/no nominations
Inside moderation channel, infractions/active nomination
Inside moderation channel, infractions/historical nominations
This commit closes #628 and closes #339