4f4953a6b8
Gag mentioning this is practically a private repo was too close to License details that it looked like it was a part of the License category. 'Is anyone really even reading this?'
59 lines
5.3 KiB
Markdown
59 lines
5.3 KiB
Markdown
# The Protector
|
|
A Custom Moderation bot I am writing for my servers and servers I am administrating.
|
|
|
|
Will become more advanced as I need more custom moderation tools.
|
|
|
|
This tool will likely not be of value to most people, I'm mostly just building it for something to do, besides it providing a few valuable tools that other moderation tools don't provide, but they're very unnecessary for most server admins/moderators/owners.
|
|
|
|
## Why
|
|
I'm creating this because a server I am an admin of recently got targeted by a spam-scam campign spamming a crypto scam image.
|
|
At the time, the owner wasn't available to grant permission for tools like Wick, so I had to come up with something on the spot; thus I created this tool.
|
|
|
|
I can now swap to another tool like Wick, but I became interested in expanding this tools functionality in ways that tools like Wick and other protection bots don't.
|
|
|
|
## What
|
|
As of now, this bot will only timeout individuals caught spamming, right now everything is super hard-coded; I needed it done quickly, so a lot of things were rushed.
|
|
|
|
Specific users can be added to a list that will allow them to bypass the moderation functions of this bot (for owners, admins, etc. who may be posting warnings, may be spamming advertising for the server itself, or may just be doing something in admin-only channels for some reason.)
|
|
|
|
Once a member spams, it will run through a filter, if it's deemed to be "infringing" it will mute the member and send the content to DMs - That being said, I was in kind of a hurry to get this up and running, so there are no "easy" configuration options, files, etc.
|
|
"send the content to DMs": This is currently set to 1 specific user, a "volunteer user".
|
|
The filter, spam amount, mute length, spam cooldown, moderation whitelist, and the "volunteer user" are saved to variables througout the code, configuring this isn't super simple, but this is something I aim to fix for a more "public release".
|
|
|
|
In the future banning will be automated (see #Todo)
|
|
|
|
## Todo:
|
|
### Image Fingerprinting
|
|
I want to create a database of "infringing" images.
|
|
When a user sends an image into the chat, it will be compared against the database of infringing images, if it's in the database, depending on severity of the image, the user will be muted or banned, if the content isn't infringing, it will be ignored. If an admin/moderator (configurable) deems an image as "infringing" they should reply to the post mentioning the bot following with the punishment; "mute" or "ban" (as of now duration will be static, mute will be a day and ban will be permananent). Once an image is deemed "infringing" the admin/moderator that sent the command will be DMed the fingerprint (unless they have DMs turned off, of which a volunteering moderator/admin will be sent the fingerprint, if one isn't set, fingerprint will not be eligable for manual removal and will need to be done through the database.) as well the fingerprint will be console logged for the bot hoster as well.
|
|
|
|
Infringing Content:
|
|
* ReporterId - The ID of the moderator/admin who reported the infringing content.
|
|
* GuildId - The ID of the Guild which made the initial report.
|
|
* Global - whether this image should be considered infringing across all moderated guilds (boolean set at startup, will apply to all reported images)
|
|
* Punishment - Whether to Ban or Mute future occurances.
|
|
* Fingerprint - The Fingerprint of the infringing image.
|
|
|
|
If you don't want to start from 0, you can set a boolean in the code to `true` which will use my personal database, this will be updated live from my bot. If you use this feature, note that my file will be readonly to any other bot using it besides mine.
|
|
|
|
`public_db_connection_string.txt` will be updated if ever the database connection string needs to be updated, the bot will check this every 12am EST, and will be automatically swapped if it's different.
|
|
Noting that this check will not happen if the readonly db boolean is `false`
|
|
|
|
### Simple Configuration
|
|
I hope to setup a configuration system that will allow moderators/admins to configure things that I currently have hardcoded, things like:
|
|
* Whitelisted user(s)
|
|
* Global Infringement
|
|
* Punishment Durations (separate mute and ban durations)
|
|
* Who gets the review messages (when a message is flagged, but isn't considered infringing, it will still be sent to DMs, this will be used to determine who gets it | Everyone in several roles? Everyone in one role? A list of users, A specific-desginated user? etc.)
|
|
* What constitutes a "flagged" content (i.e. "it contains mentions" or "it contains an image" noting that all images will be checked regardless of whether it's flagged, this is more an Anti-Spam feature.)
|
|
|
|
## Suggestions
|
|
I am open to suggestions, but note that I would like to get through the above TODO list before working on any new challenge, therein if you provide a suggestion, it will likely be added to the bottom of the TODO list, alternatively if you would like it added to this bot you're welcome to:
|
|
|
|
## Contribute
|
|
I'm open to any sort of contribution. (real contributions, not just minute readme changes are not real contributions.)
|
|
Feel free to open a Pull Request with any functional changes you may have changed/added.
|
|
(This is hosted on my personal Gitea server, so I am unsure how this will work...)
|
|
|
|
## License
|
|
This project is published under the MIT License. |