From 490080b17a51f26d463834075e45278e7bb3cd9b Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 04:30:45 +0100 Subject: [PATCH] add seperate events for boosting --- .../java/cc/fascinated/bat/features/logging/LogType.java | 3 ++- .../bat/features/logging/listeners/MemberListener.java | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/logging/LogType.java b/src/main/java/cc/fascinated/bat/features/logging/LogType.java index cea0ce9..bede8bd 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogType.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogType.java @@ -30,7 +30,8 @@ public enum LogType { MEMBER_BAN(LogCategory.MEMBER, "Member Ban"), MEMBER_UNBAN(LogCategory.MEMBER, "Member Unban"), MEMBER_TIMEOUT(LogCategory.MEMBER, "Member Timeout"), - MEMBER_BOOST(LogCategory.MEMBER, "Member Boost"), + MEMBER_BOOSTED(LogCategory.MEMBER, "Member Boost Add"), + MEMBER_BOOST_EXPIRE(LogCategory.MEMBER, "Member Boost Remove"), /** * Channel Events diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java index 0d6517e..0556a7b 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java @@ -25,8 +25,6 @@ import net.dv8tion.jda.api.events.guild.member.update.GuildMemberUpdateTimeOutEv import net.dv8tion.jda.api.events.user.update.UserUpdateAvatarEvent; import net.dv8tion.jda.api.events.user.update.UserUpdateGlobalNameEvent; import net.dv8tion.jda.api.events.user.update.UserUpdateNameEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; @@ -238,7 +236,7 @@ public class MemberListener implements EventListener { oldBoostTime = oldBoostTime == null ? OffsetDateTime.now() : oldBoostTime; long boostAmount = ChronoUnit.MONTHS.between(oldBoostTime, newBoostTime); long seconds = newBoostTime.toInstant().getEpochSecond(); - logFeature.sendLog(guild, LogType.MEMBER_BOOST, EmbedUtils.successEmbed() + logFeature.sendLog(guild, LogType.MEMBER_BOOSTED, EmbedUtils.successEmbed() .setDescription(new EmbedDescriptionBuilder("Member Boosted") .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Boost Months: %s".formatted(boostAmount), true) @@ -255,7 +253,7 @@ public class MemberListener implements EventListener { newBoostTime = newBoostTime == null ? OffsetDateTime.now() : newBoostTime; long boostAmount = ChronoUnit.MONTHS.between(newBoostTime, oldBoostTime); - logFeature.sendLog(guild, LogType.MEMBER_BOOST, EmbedUtils.errorEmbed() + logFeature.sendLog(guild, LogType.MEMBER_BOOST_EXPIRE, EmbedUtils.errorEmbed() .setDescription(new EmbedDescriptionBuilder("Member Boost Expired") .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Boosts Removed: %s".formatted(boostAmount), true)