forked from Cog-Creators/Red-DiscordBot
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gatekeep] A variety of quality of life improvements #668
Open
Tsunderarislime
wants to merge
7
commits into
SFUAnime:V3/testing
Choose a base branch
from
Tsunderarislime:V3/testing
base: V3/testing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Commands for manually adding/removing users to the watch list now accept a discord.User object, which interprets both user IDs and usernames. Also modified pagination size for the word lists from 300 to 200. 300 characters was causing embeds to become too tall. Lastly, added a method of testing messages and evaluating scores.
Forgot to change an 'id' to 'user.id', which cause the if statement to always evaluate to true. Fixed, now adding the same user multiple times does not work, they can only be added once.
The user.id checks in addUser and removeUser were removed, as the discord.User class should handle invalid user IDs automatically. Also removed the Optional[str] in testMsg.
Injabie3
approved these changes
Feb 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some additional considerations
Suggestions have been implemented. I also fixed a bug when those conditions are met, where the code after the async block would still be executed. Return statements have been added in those if blocks. |
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.
Quality of Life Changes
Word list display from listWords now displays the words in alphabetical order
Currently, the word list is displayed by insertion order. As the word list grows, it will become more confusing to find a specific word in the list. So I changed the behaviour such that it will now display the words alphabetically.


Before:
After:
New commands to clear the word list and user watch list
[p]gatekeep word clear
or[p]gatekeep word reset
[p]gatekeep user clear
or[p]gatekeep user reset
These commands will require confirmation to use, just like initWatchList.
New counter for the total number of users banned from the server
I wanted to keep track this stat. This counter will show up in the
[p]gatekeep status
command.Rewording of the message for invalid strings in removeWord
Currently, this would tell the user that the string cannot be empty, i.e.
""
. However, the command also rejects strings consisting of multiple words, i.e.two words
. The message for invalid strings was updated to reflect this behaviour.