diff --git a/src/main/java/com/beanbeanjuice/cafebot/commands/social/MemberCountCommand.java b/src/main/java/com/beanbeanjuice/cafebot/commands/social/MemberCountCommand.java index 33508d1a..9fe56a6d 100644 --- a/src/main/java/com/beanbeanjuice/cafebot/commands/social/MemberCountCommand.java +++ b/src/main/java/com/beanbeanjuice/cafebot/commands/social/MemberCountCommand.java @@ -6,7 +6,6 @@ import com.beanbeanjuice.cafebot.utility.commands.ICommand; import com.beanbeanjuice.cafebot.utility.helper.Helper; import net.dv8tion.jda.api.Permission; -import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; public class MemberCountCommand extends Command implements ICommand { @@ -17,13 +16,12 @@ public MemberCountCommand(final CafeBot cafeBot) { @Override public void handle(SlashCommandInteractionEvent event) { - Guild guild = event.getGuild(); - int members = guild.getMemberCount(); - - event.getHook().sendMessageEmbeds(Helper.successEmbed( - "Member Count", - String.format("There are %d people in this server!", members) - )).queue(); + event.getGuild().retrieveMetaData().queue((metadata) -> { + event.getHook().sendMessageEmbeds(Helper.successEmbed( + "Member Count", + String.format("There are %d people in this server!", metadata.getApproximateMembers()) + )).queue(); + }); } @Override