add feature disabled check
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 44s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 44s
This commit is contained in:
parent
8b451c6ee5
commit
a057853cbd
@ -86,6 +86,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onGuildMessageReceive(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull MessageReceivedEvent event) {
|
public void onGuildMessageReceive(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull MessageReceivedEvent event) {
|
||||||
if (event.getAuthor().isBot()) return;
|
if (event.getAuthor().isBot()) return;
|
||||||
|
if (guild.getFeatureProfile().isFeatureDisabled(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
|
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
|
||||||
if (messages.size() >= 10) {
|
if (messages.size() >= 10) {
|
||||||
@ -97,6 +100,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGuildMessageDelete(@NonNull BatGuild guild, BatUser user, DiscordMessage message, @NonNull MessageDeleteEvent event) {
|
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<>());
|
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
|
||||||
if (messages.size() >= 10) {
|
if (messages.size() >= 10) {
|
||||||
messages.remove(0);
|
messages.remove(0);
|
||||||
@ -110,6 +116,9 @@ public class MessageSnipeFeature extends Feature implements EventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGuildMessageEdit(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull MessageUpdateEvent event) {
|
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<>());
|
List<SnipedMessage> messages = snipedMessages.getOrDefault(guild, new ArrayList<>());
|
||||||
if (messages.size() >= 10) {
|
if (messages.size() >= 10) {
|
||||||
messages.remove(0);
|
messages.remove(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user