add feature disabled check

This commit is contained in:
Lee 2024-07-01 21:21:47 +01:00
parent 8b451c6ee5
commit a057853cbd

@ -86,6 +86,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
@Override
public void onGuildMessageReceive(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull MessageReceivedEvent event) {
if (event.getAuthor().isBot()) return;
if (guild.getFeatureProfile().isFeatureDisabled(this)) {
return;
}
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
if (messages.size() >= 10) {
@ -97,6 +100,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
@Override
public void onGuildMessageDelete(@NonNull BatGuild guild, BatUser user, DiscordMessage message, @NonNull MessageDeleteEvent event) {
if (guild.getFeatureProfile().isFeatureDisabled(this)) {
return;
}
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
if (messages.size() >= 10) {
messages.remove(0);
@ -110,6 +116,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
@Override
public void onGuildMessageEdit(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull MessageUpdateEvent event) {
if (guild.getFeatureProfile().isFeatureDisabled(this)) {
return;
}
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
if (messages.size() >= 10) {
messages.remove(0);