Adds ping-protection module.#168
Conversation
…w file for correct tracking.
… advanced configuration in moderation.json and made the choices inside depend on it because I forgot to :/ Added the options to enable/disable pings/modlogs/logs kept after leave and made the choices depend on it + made those choices with numbers select instead of integers for almost 0 user-error issues.
…ded into the message editor for the warning message
…o debug code, has been tested and is currently ongoing extensive testing to ensure absolutely everythig works as supposed to
…lish while remaining the same functions. Removed a few locales that are unused and updated some locales for better understanding. Fully tested extensively. Not verified by GitHub because I code in VSCode.
…asic pings count config
Listed the warnings for all commands except the panel command as the bot already checks for administrator perms.
|
By the way to maybe answer some questions you may have:
Just in case you were wondering any of the above, then you have the answers ^^ |
SCDerox
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Without testing your code, I was able to identify multiple issues that need to be addressed - feel free to comment on them if you disagree.
Additionally:
- Pings still go through, meaning that users still recive the pings "protected" by this module. This means that this module does not prevent pings, instead it punishes them. Instead of doing this, the module should create and maintain an Auto Mod Rule and react to the autoModerationActionExecution event when the rule gets triggered to run punishments.
If you have any questions, concerns or disagree with any of my comments, please reply to them directly or let me know!
Happy holidays!
|
Thanks for the requested changes! I will immediately work on resolving these, for ones that I have questions about I let them as a reply. |
|
Hey Simon, I have completed the changes requested. I think most (if not all) of your changes have been done, but it's been many hours so I can't remember if I did exactly all. Please let me know if everything has been solved now! |
SCDerox
left a comment
There was a problem hiding this comment.
- Still not using automod APIs
- Please mark comments that you solved as "Resolved", otherwise I am unable to review the changes.
|
Alright, I just reviewed all changes and I did everything except indeed the automod API which I forgot, I will be working on that now! |
|
You could also add the automod feature as a configurable option, but I think to truly "protect" against pings, we need to actually be able to block them. This would make the module way more powerful 😄 |
|
Disclosing how AI used as a comment here is fine or you can add it to your original PR body, no need to add it into the files themselves. |
|
The branch is now available: beta-discordjs14. Please switch the base branch of this PR to that branch. |
|
Hey Simon, i've addressed your feedback which you can see in my ping-protection module branch. I have not yet put itto the main branch here as I am currently working on adjusting the code to DJS V14, but in the meantime if you want to you can look there but after I changed the code to DJS V14 it will show up here anyway ^^ |
|
Alrighty, after alot of testing and things breaking, the Ping Protection module is finally done in Discord.JS V14, with very slight logic changes because of it (such as using .toJSON for actionRows etc because Discord.JS V14 basically requires it now) |
|
I've also upgraded readability for the eyes in some files that I forgot earlier, I hope that helps aswell |
|
Hi,
|
SCDerox
left a comment
There was a problem hiding this comment.
Hi, here are some additional issues I found. Please apologize for the delay, I am currently very sick sitting in a hotel room in Pitsburgh. Please let me know if you have any questions or concerns.
Additional feature suggestions:
- When a message is blocked by automod, consider adding an option that sends the warning message via DM to the user.
…ually properly support multiple moderation actions (not tested before, and didn't work during testing)
|
Hi Simon, |
SCDerox
left a comment
There was a problem hiding this comment.
I have found some bugs and issues, please address them.
Additionally, when using the automod features, pings were not shown in the history command for me, could you check if this works for you?
Thanks"
modules/ping-protection/events/autoModerationActionExecution.js
Outdated
Show resolved
Hide resolved
|
Thanks for the feedback!
|
… to make it work properly.
|
Hey Simon, I have addressed the changes and it is now in this new commit.
Thank you for the feedback - I haven't tested this version alot besides for the improvments/new features/slight changes - I will test this thoroughly soon |
|
Sounds great, please let me know when testing is completed. |
… waning message configuration and added an emoji to the why easter egg.
|
Hi Simon, I have tested every feature to it's full extent after my initial testing and I noticed (and fixed) the following:
Also added the most useless detail ever:
So far I have found no bugs which is great ^^ |
SCDerox
left a comment
There was a problem hiding this comment.
Looking great to me, rolling out on SCNX Beta likely today!
* update to discord.js v14 * fixed missing strings * fixed broken info-commands * fixed duplicated entry * Adds ping-protection module. (#168) * Added the base module folders and module.json * Added all folders necessary and the configuration files for each folder * Added a test command * removed the manage file * Added, renamed and deleted some files as necessary and coded the models. * Renamed action.js to moderation.js, coded multiple things, added a new file for correct tracking. * Forgot to update module.json, now updated aswell * Added additional information in ping-protection.js * Disabled allowing reply pings, added the enable moderation and enable advanced configuration in moderation.json and made the choices inside depend on it because I forgot to :/ Added the options to enable/disable pings/modlogs/logs kept after leave and made the choices depend on it + made those choices with numbers select instead of integers for almost 0 user-error issues. * Added support for actually correct parameters and those parameters added into the message editor for the warning message * Added proper support for localization, and coded the events * Completed the full module and fixed some critical bugs that caused the bot to crash * Cleaned up some code notes I used for debugging * Completely finished the module and worked tirelessly for many hours to debug code, has been tested and is currently ongoing extensive testing to ensure absolutely everythig works as supposed to * Debugged absolutely everything, removed like 300 lines of code for polish while remaining the same functions. Removed a few locales that are unused and updated some locales for better understanding. Fully tested extensively. Not verified by GitHub because I code in VSCode. * Added the option to lower mod actions history * Made the deault value of pings to trigger action 10 instead of 5 in basic pings count config * Added the commands warnings for most commands Listed the warnings for all commands except the panel command as the bot already checks for administrator perms. * Almost completely rewrote the module to make sure the modules works as supposed to with SCNX. * Added "automod" abilities - Will now delete the original message by default with the message content and allows to configure both options * (not working correctly) added automod integration and some small changes * Fixed the * Removed the feature that didn't work (reposting), adds a custom message to the automod message block. Also the bot now deletes the rule it created if automod enabled = false * Fixed the bug of the bot still sending the warning and punishing if limit reached with reply pings even when it's allowed in config * Added a funny easter egg * Some QOL improvements, including merging the list commands * Added some new options in the config * Update configuration.json * Fix self-ping condition to allow self-pinging * Ping protection V1, in Discord.JS V14 * Ping Protection V1 * Changed code to the requested changes, and adjusted code logic to actually properly support multiple moderation actions (not tested before, and didn't work during testing) * Made adjustments to code as requested, and added an intent to main.js to make it work properly. * Fixed the missing footer on embeds. Fixed a small typo in the default waning message configuration and added an emoji to the why easter egg. --------- Co-authored-by: Kevinking500 <Kevinking500> * Ping Protection V1.1 (#171) * Added the base module folders and module.json * Added all folders necessary and the configuration files for each folder * Added a test command * removed the manage file * Added, renamed and deleted some files as necessary and coded the models. * Renamed action.js to moderation.js, coded multiple things, added a new file for correct tracking. * Forgot to update module.json, now updated aswell * Added additional information in ping-protection.js * Disabled allowing reply pings, added the enable moderation and enable advanced configuration in moderation.json and made the choices inside depend on it because I forgot to :/ Added the options to enable/disable pings/modlogs/logs kept after leave and made the choices depend on it + made those choices with numbers select instead of integers for almost 0 user-error issues. * Added support for actually correct parameters and those parameters added into the message editor for the warning message * Added proper support for localization, and coded the events * Completed the full module and fixed some critical bugs that caused the bot to crash * Cleaned up some code notes I used for debugging * Completely finished the module and worked tirelessly for many hours to debug code, has been tested and is currently ongoing extensive testing to ensure absolutely everythig works as supposed to * Debugged absolutely everything, removed like 300 lines of code for polish while remaining the same functions. Removed a few locales that are unused and updated some locales for better understanding. Fully tested extensively. Not verified by GitHub because I code in VSCode. * Added the option to lower mod actions history * Made the deault value of pings to trigger action 10 instead of 5 in basic pings count config * Added the commands warnings for most commands Listed the warnings for all commands except the panel command as the bot already checks for administrator perms. * Almost completely rewrote the module to make sure the modules works as supposed to with SCNX. * Added "automod" abilities - Will now delete the original message by default with the message content and allows to configure both options * (not working correctly) added automod integration and some small changes * Fixed the * Removed the feature that didn't work (reposting), adds a custom message to the automod message block. Also the bot now deletes the rule it created if automod enabled = false * Fixed the bug of the bot still sending the warning and punishing if limit reached with reply pings even when it's allowed in config * Added a funny easter egg * Some QOL improvements, including merging the list commands * Added some new options in the config * Update configuration.json * Fix self-ping condition to allow self-pinging * Ping protection V1, in Discord.JS V14 * Ping Protection V1 * Changed code to the requested changes, and adjusted code logic to actually properly support multiple moderation actions (not tested before, and didn't work during testing) * Made adjustments to code as requested, and added an intent to main.js to make it work properly. * Fixed the missing footer on embeds. Fixed a small typo in the default waning message configuration and added an emoji to the why easter egg. * Ping Protection V1.1 * Quickly updated locales for better explanation about exceptions for whitelisted * Ping Protection V1.1 remastered * Another remastered version * Added categories in 2 configs * Used proper emoji's that SCNX supports * Used the new updated ones I suggested that were added (and hopefully also work) * Updated some small changes from Copilot --------- Co-authored-by: Kevinking500 <Kevinking500> * bumped changes * feat(economy): implements "Artikel bearbeiten" (#179) * feat(economy): implements "Artikel bearbeiten" Implements https://featureboard.net/suggestions/95f5a741-6d35-4b86-9c67-abd900dca76e * fix(economy): Adressed the issues copilot pointed out and also fixed them in createShopItem --------- Co-authored-by: Kevin <kvanduijn82@gmail.com> Co-authored-by: jateute <git@jateute.de>
A full module dedicated to protecting specific users/roles for future pings!
Features:
Maybe even more features that I forgot to mention here lol
This module has been extensively tested by me and my testers over a 3 day period going over every feature, including after a full code polish. Changes may look longer/shorter in duration between them because I only commit changes once tested it works.
About AI Usage: