-
-
Notifications
You must be signed in to change notification settings - Fork 46
Adds ping-protection module. #168
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 😄 |
|
Hey, I have added that the bot will by default delete the original message with the ping, and adds the original content to the warning embed. Let me know if I need to adjust anything! |
|
I think the Discord Native Automod has a crucial feature that you cannot do, even with deleting the message: blocking the message from triggering a ping to the user, so I would find it crucial to be supported rather than simply deleting messages. |
|
Oh I actually didn't know that, that's a pretty neat feature! |
|
Thanks for explaining; however, I think it would be crucial to offer such a functionality at release, to ensure that we're delivering on user expectations. The automod API is built into discord.js (even at v13) and can be used easily (e.g. you just create a rule, update it every time the bot configuration changes, and listen to the event when it gets triggered), but I get if you are not interested in implementing such functionality at this point. If that's the case, please let me know, and I will look into alternatives. |
|
Ahhh okay if that's the case then I can definitely look into it a bit more for now. Thanks for providing that information as it's really useful, I think that if I do think that it's simple enough for now, that I will let you know tomorrow or atleast within the next 48 hours for a new commit with the automod integration ^^ |
|
No stress, happy to help if you have any questions or need guideance - here on GitHub or in the #oss-chat on Discord 😄 |
|
So I looked over the automod docs completely with rules, and I couldn't find something that let's the user send the ping message but make the ping not go through as an actual ping. Which action type is it that's needed or do you mean actually blocking the message? |
|
Ah yes thanks for the additional information! |
|
You can still trigger the warning message and moderation action manually, even without the message being sent by listing to the event and triggering relevant calls. |
|
Yeah I am trying a workaround to log it into the history and moderate, I am planning a redesign of the module and logs when it is enabled, so it won't do something like showing a link to jump to the message when there is no such link etc. |
|
I am currently facing multiple issues with it, currently thr only thing I can manage to get it done correctly is blocking the message. Other things seem to not work and are likely only going to work correctly in Discord.js V14 but I might add the commit of the code that blocks the message but doesn't do other things it's supposed to so you can take a look at it |
|
I am unsure what isn't working, your comment doesn't include any details. Since the API and event are fully supported on V13, simply upgrading discord.js won't likely address your issues. |
|
It's mainly an issue with the reposting the message content and the alert channel for AutoMod. |
|
Please push your latest work, so I can take a look. I can't help without seeing your code. |
|
Here you go, there might be some verbose logging, you can ignore that as I basically just reverted to an old version and I usually log alot to diagnose issues as I noticed some issues fail silently. |
modules/ping-protection/events/autoModerationActionExecution.js
Outdated
Show resolved
Hide resolved
|
Damn that actually resolved a handful of issues. |
|
After some consideration I am doing the following changes instead: I will commit the following changes after I coded and tested it ^^ |
…ge to the automod message block. Also the bot now deletes the rule it created if automod enabled = false
|
To get access to the channel, use [event].channelId (which needs to be fechted), to get access to the content, use [event].content |
|
Ahhh okay noted. Though I removed it not only because I didn't get it to work, also because the alert message already shows the content to the protected people/people with the protected role meaning doing both a repost and sending the alert is basically double double. I have sent the full code of the bot now that works as supposed to! |
…imit reached with reply pings even when it's allowed in config
|
Hi, i've found a quite critical bug when testing extensively today for Quality Assurance.
Please review the full code with soon if you haven't already ^^ |

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.