don't show old avatar url and make the thumbnail of the log the new avatar
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s

This commit is contained in:
Lee 2024-07-04 07:03:48 +01:00
parent dc04a2f36a
commit 43c5473a4f

@ -30,13 +30,13 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.OffsetDateTime; import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List; import java.util.List;
/** /**
* @author Fascinated (fascinated7) * @author Fascinated (fascinated7)
*/ */
@Component @Log4j2 @Component
@Log4j2
public class MemberListener implements EventListener { public class MemberListener implements EventListener {
private final LogFeature logFeature; private final LogFeature logFeature;
private final GuildService guildService; private final GuildService guildService;
@ -150,9 +150,10 @@ public class MemberListener implements EventListener {
logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed() logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed()
.setDescription(new EmbedDescriptionBuilder("Member Avatar Updated") .setDescription(new EmbedDescriptionBuilder("Member Avatar Updated")
.appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true) .appendLine("Member: %s".formatted(user.getDiscordUser().getAsMention()), true)
.appendLine("Old Avatar: %s".formatted(oldAvatarUrl == null ? "None" : "[avatar](%s)".formatted(oldAvatarUrl)), true) // .appendLine("Old Avatar: %s".formatted(oldAvatarUrl == null ? "None" : "[avatar](%s)".formatted(oldAvatarUrl)), true)
.appendLine("New Avatar: [avatar](%s)".formatted(newAvatarUrl), true) .appendLine("New Avatar: [avatar](%s)".formatted(newAvatarUrl), true)
.build()) .build())
.setThumbnail(newAvatarUrl)
.build()); .build());
} }
} }