From eb8408eb8f21f1f414d7e071102431eb7af56cfa Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 28 Jun 2024 15:32:46 -0500 Subject: [PATCH] Fix NPE caused by default avatars + make MemberCountCommand message consistent --- .../cc/fascinated/bat/command/impl/avatar/UserSubCommand.java | 2 +- .../fascinated/bat/command/impl/server/MemberCountCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/command/impl/avatar/UserSubCommand.java b/src/main/java/cc/fascinated/bat/command/impl/avatar/UserSubCommand.java index 3a5cc99..2248297 100644 --- a/src/main/java/cc/fascinated/bat/command/impl/avatar/UserSubCommand.java +++ b/src/main/java/cc/fascinated/bat/command/impl/avatar/UserSubCommand.java @@ -38,7 +38,7 @@ public class UserSubCommand extends BatSubCommand { User target = userOption.getAsUser(); interaction.replyEmbeds(EmbedUtils.genericEmbed() .setAuthor("%s's Avatar".formatted(target.getName()), null, target.getEffectiveAvatarUrl()) - .setImage(target.getAvatar().getUrl(4096)) + .setImage(target.getEffectiveAvatarUrl()) .build() ).queue(); } diff --git a/src/main/java/cc/fascinated/bat/command/impl/server/MemberCountCommand.java b/src/main/java/cc/fascinated/bat/command/impl/server/MemberCountCommand.java index 43f9d4e..2e459f0 100644 --- a/src/main/java/cc/fascinated/bat/command/impl/server/MemberCountCommand.java +++ b/src/main/java/cc/fascinated/bat/command/impl/server/MemberCountCommand.java @@ -23,7 +23,7 @@ public class MemberCountCommand extends BatCommand { public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) { EmbedBuilder embed = EmbedUtils.genericEmbed().setAuthor("Member Count"); Guild discordGuild = guild.getDiscordGuild(); - embed.setDescription(discordGuild.getName() + " has a total of " + discordGuild.getMembers().size() + " members."); + embed.setDescription("**%s** has a total of %s members.".formatted(discordGuild.getName(), discordGuild.getMembers().size())); interaction.replyEmbeds(embed.build()).queue(); } } \ No newline at end of file