[feat]: Add pre-message send prevention and restrictions manager#12
Open
not-meet wants to merge 1 commit into
Open
[feat]: Add pre-message send prevention and restrictions manager#12not-meet wants to merge 1 commit into
not-meet wants to merge 1 commit into
Conversation
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.
Summary
Previously, when a user was flagged as a spammer, the system silently stored their spam level in persistence with zero user-facing feedback. Flagged users had no idea they were being monitored or restricted, and could continue sending messages even after being placed on cooldown or suspended.
This PR adds two things:
IPreMessageSentPreventrestricted users are now actually blocked from sending messagesChanges Made
added checkPreMessageSentPrevent,executePreMessageSentPrevent, checkPostMessageSent in
AppsSpamMonitorApp.ts - to gate messages from restricted users before they are sent.
restrictionsManager.ts - handles DMing the flagged user and applying the action based on their spamming level
en.ts - single source of truth for all runtime notification message strings, keyed by SpammingLevel as typed functions so duration is injected dynamically
messageUtils.ts - formatDuration (converts ms to human-readable string) and buildMessage
userStatusStore.ts - added method to fetch if user is restricted or not
DEMO
Screencast.from.2026-06-06.02-18-55.webm
Closes #9