-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add 'user notes' functionality #191
Merged
Merged
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
Erisa
reviewed
Jun 5, 2024
Erisa
requested changes
Jun 27, 2024
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.
Can we log all note events to the mod log, please?
Absolutely! Done in 3d27ab3 |
Erisa
approved these changes
Jun 30, 2024
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
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.
This PR closes #135.
Adds the ability to set notes on users. These notes are shown only to moderators, and can be queried manually or shown automatically when the target user is warned or opens a modmail thread. Notes can also be set to show only one time, after which they will be removed. The
/note
command offers options to add, edit, delete, list, and show details for notes.Commands that require referencing a note (e.g. the target note in
/note details
) support autocomplete, just like/warndetails
& similar.Note embeds are very similar to warning embeds. Note commands are all ephemeral by default, but
/note list
and/note details
can be shown publicly in chat for ease of reference.When a modmail thread is opened for a user who has notes set to 'Show on Modmail', Cliptok will send an embed with only the relevant notes into the thread channel, similar to how it already sends warning & mute information if the user is muted.
When a user with notes set to 'Show on Warn' is issued a warning, Cliptok will send an alert into #investigations pinging the moderator responsible for the warning. Relevant notes will be displayed, but only if either A) they are set to 'Show all Mods', or B) the moderator responsible for the warning was also responsible for the note(s).
'Show all Mods' only applies to warning alerts. Notes set to 'Show on Modmail' will be displayed in modmail threads regardless of the 'Show all Mods' setting.
Notes are stored in Redis directly next to warnings—they are not stored under a separate hash like
userNotes
. They use the same ID namespace as warnings. Notes and warnings both have a newWarningType
property to help distinguish between them. This type can either beWarning
orNote
. Older warnings without a type are treated as having the typeWarning
.