forked from Fascinated/Bat
Fix NPE caused by default avatars + make MemberCountCommand message consistent
This commit is contained in:
parent
20905a7962
commit
eb8408eb8f
@ -38,7 +38,7 @@ public class UserSubCommand extends BatSubCommand {
|
|||||||
User target = userOption.getAsUser();
|
User target = userOption.getAsUser();
|
||||||
interaction.replyEmbeds(EmbedUtils.genericEmbed()
|
interaction.replyEmbeds(EmbedUtils.genericEmbed()
|
||||||
.setAuthor("%s's Avatar".formatted(target.getName()), null, target.getEffectiveAvatarUrl())
|
.setAuthor("%s's Avatar".formatted(target.getName()), null, target.getEffectiveAvatarUrl())
|
||||||
.setImage(target.getAvatar().getUrl(4096))
|
.setImage(target.getEffectiveAvatarUrl())
|
||||||
.build()
|
.build()
|
||||||
).queue();
|
).queue();
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction interaction) {
|
||||||
EmbedBuilder embed = EmbedUtils.genericEmbed().setAuthor("Member Count");
|
EmbedBuilder embed = EmbedUtils.genericEmbed().setAuthor("Member Count");
|
||||||
Guild discordGuild = guild.getDiscordGuild();
|
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();
|
interaction.replyEmbeds(embed.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user