Skip to content

Ping Protection V2.5 - #209

Open
Kevinking500 wants to merge 19 commits into
ScootKit:mainfrom
Kevinking500:ping-protection-v2.5
Open

Kevinking500 wants to merge 19 commits into
ScootKit:mainfrom
Kevinking500:ping-protection-v2.5

Conversation

@Kevinking500

@Kevinking500 Kevinking500 commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Ping protection V2.5 - The best aimed ping protection system, now improved

Changelog:

  • Moderation rules modularity: Moderation rules now have an option to let it apply to select type of pings (mention, reply or both)
  • Ping type clarified: Ping types are now clarified in the user's history, showing if it was a reply ping or a mention.
  • Improved moderation rule timeframe: The timeframe of each moderation action is no longer limited to days - users can now input, for example, 10s and it will check for the actions done in the last 10s for that moderation rule. When no text is added, it falls back to days (so old configs will stay to their days configuration to avoid breaking them)
  • Time-framed data deletion: Higher ups can now decide to only delete data from a later date (so for example deleting data that is >7d old instead of everything)
  • Automatic warning message deletion: Warning messages clutter up channels. Users can now choose if and after how long the message auto-deletes.
  • Toggle your protection via a command: Some staff don't mind being pinged while being active in the server, so a new subcommand now allows protected users to toggle their protection status. If they don't mind being pinged for some time, they toggle it off, and back on after some time. The protection toggles back on automatically after 24h to prevent staff turning their protection off while they should be protected from the config.
  • Longer leaver data retention: Leaver data retention can now be kept for up to 60d instead of 7d, handy for investigations and similar, idk why I kept the limit to 7d before. Default is now also 7d.
  • Kick DM message: Users are now DMed a customizable message when they are kicked because of a moderation action instead of being kicked into the void
  • And some other QoL improvements, like shortened confirmation phrase to prevent translation issues

AI usage:

  • Thinking of some features
  • Making the migrations file
  • Fixing test files
    This will likely be the last update of this module as you know my priorities shifted, though unless crucial (big bug reports etc) things appear.

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Lovely failing tests.. Gtg to school now so i'll see later

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Holy moly thank Copilot for this ragebaiting of a fix (i'll probs have to do it again later, idk why I focussed on doing ts now)

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Idk why I did feat, felt professional ig. Technically this update is now complete, though i'll be doing a code optimization and cleanup (mainly thanks to AI, if it works properly) and seperating it into seperate logic files. I also see some duplicated functions (like the user history for normal and panel activations)

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Code has been cleaned up to inside a folder which should make it easier to read and whatnot. I'll fix the tests later on

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Hi @SCDerox, since this PR changed quite some features and added some, is the tests system still up-to-date for this module? I honestly have no idea at all how the tests work so i'm just asking you to quickly review if it just needs a fix or an actual update :)

@SCDerox

SCDerox commented Sep 29, 2026

Copy link
Copy Markdown
Member

If you change the behavior of the module, you'll likely need to update tests 😄

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Thanks for letting me know- i'll work on it this weekend ^^

@Kevinking500

Copy link
Copy Markdown
Contributor Author

@SCDerox Sorry again, but since I have 0 documentation (and also don't understand, sorry) about tests, would you mind if you could ask claude or whatever to update the tests, would be highly appreciated, thanks!

@Kevinking500

Copy link
Copy Markdown
Contributor Author

Now what, this wasted 8% of my Gemini pro usage for it to keep failing

@Kevinking500
Kevinking500 marked this pull request as ready for review October 2, 2026 19:12

@SCDerox SCDerox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this, the split into core/* and dropping the duplicated subcommand dispatch are nice improvements.

Heads up: this is an AI-assisted first pass over the diff. A manual review by a maintainer will follow, so some points may be wrong or intentional. I checked the suggestions locally: with the test mocks updated as noted inline, all 12 ping-protection suites pass (131 tests).

Blocking:

  1. timeframeDays -> customTimeFrame resets existing custom timeframes (inline)
  2. The bot-ping easter egg returns before the protection check, so it bypasses protection (inline)
  3. /ping-protection user history and actions-history have no permission check (inline)
  4. The toggle can miss Discord's 3 second reply window (inline)
  5. AutoMod is not re-synced when a 24h pause expires (inline)
  6. pingType is not backfilled, so pre-upgrade history is ignored by "Mentions"/"Reply pings" rules (inline)
  7. config-localizations/en.json was not regenerated, so the new fields (allowProtectionToggle, kickPunishmentMessage, autoDeleteWarningMessage, deleteWarningMessageTime, pingsType, customTimeFrame) get no translations. Please run node config-localizations/generate-files.js and commit the result.

Comment thread modules/ping-protection/configs/moderation.json
Comment thread modules/ping-protection/events/messageCreate.js
Comment thread modules/ping-protection/commands/ping-protection.js
Comment thread modules/ping-protection/commands/ping-protection.js
Comment thread modules/ping-protection/configs/configuration.json Outdated
Comment thread modules/ping-protection/commands/ping-protection.js
Comment thread modules/ping-protection/core/toggle.js
@Kevinking500
Kevinking500 requested a review from SCDerox October 12, 2026 18:29

This branch has not been deployed

No deployments
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