Skip to content
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
wants to merge 7 commits into
base: V3/testing
Choose a base branch
from

Conversation

Tsunderarislime
Copy link

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:
Screenshot_20250222_174704
After:
Screenshot_20250222_174725

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.

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.
Copy link
Member

@Injabie3 Injabie3 left a 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

@Tsunderarislime
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants