Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Spam detection #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Spam detection #14

wants to merge 3 commits into from

Conversation

cbrt-x
Copy link

@cbrt-x cbrt-x commented Nov 6, 2021

Added spam detection.

There still is a lot of TODO's and placeholders as some things are not implemented yet. Those need to be replaced.

Note that maybe the Config items I put in ModerationConfig could be put into another config eventually.

Added spam detection.

There still is a lot of TODO's and placeholders as some things are not implemented yet. Those need to be replaced.

Note that maybe the Config items I put in ModerationConfig could be put into another config eventually.
@MoonTM-GIT MoonTM-GIT linked an issue Nov 6, 2021 that may be closed by this pull request
@MoonTM-GIT MoonTM-GIT added Enhancement New feature or request Moderation System Related to the moderation subsystem. labels Nov 6, 2021
Comment on lines +18 to +30
int amountOfMessages = (int) Bot.messageCache.get(event.getMessageAuthor())
.stream()
//TODO get time from config
.filter(msg -> msg.getCreationTimestamp().isAfter(Instant.now().minus(Duration.ofSeconds(-1))))
.count();

//TODO get amount from config
if (amountOfMessages >= -1) {
//TODO spam detected
// placeholder for checkstyle not to complain.
// should be replaced with a warn + purge which is not implemented yet
event.deleteMessage("spam");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Address these TODOs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement New feature or request Moderation System Related to the moderation subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Spam Filtering
4 participants