mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-05-24 07:17:46 +00:00
[AB-xxx] adding honeypot message feature to ban members that message a certain channel
This commit is contained in:
@@ -2,6 +2,8 @@ package dev.sheldan.abstracto.moderation.config.feature;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureConfig;
|
||||
import dev.sheldan.abstracto.core.config.FeatureDefinition;
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import dev.sheldan.abstracto.moderation.config.feature.mode.HoneypotMode;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -12,6 +14,7 @@ public class HoneyPotFeatureConfig implements FeatureConfig {
|
||||
|
||||
public static final String HONEYPOT_ROLE_ID = "honeypotRoleId";
|
||||
public static final String HONEYPOT_IGNORED_LEVEL = "honeypotIgnoredLevel";
|
||||
public static final String HONEYPOT_CHANNEL = "honeypotChannel";
|
||||
public static final String HONEYPOT_IGNORED_JOIN_DURATION_SECONDS = "honeypotIgnoredJoinDurationSeconds";
|
||||
|
||||
@Override
|
||||
@@ -21,6 +24,11 @@ public class HoneyPotFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public List<String> getRequiredSystemConfigKeys() {
|
||||
return Arrays.asList(HONEYPOT_ROLE_ID, HONEYPOT_IGNORED_LEVEL, HONEYPOT_IGNORED_JOIN_DURATION_SECONDS);
|
||||
return Arrays.asList(HONEYPOT_ROLE_ID, HONEYPOT_IGNORED_LEVEL, HONEYPOT_IGNORED_JOIN_DURATION_SECONDS, HONEYPOT_CHANNEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FeatureMode> getAvailableModes() {
|
||||
return Arrays.asList(HoneypotMode.values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package dev.sheldan.abstracto.moderation.config.feature.mode;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.FeatureMode;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum HoneypotMode implements FeatureMode {
|
||||
ROLE("honeypotRole"),
|
||||
MESSAGE("honeypotMessage");
|
||||
|
||||
private final String key;
|
||||
|
||||
HoneypotMode(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user