From d0ba6e72a4b8f7aabbbad0844b6fae1b5ec004ec Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 6 Jul 2024 19:41:16 +0100 Subject: [PATCH] fix pp size for not in guild --- .../bat/features/base/commands/fun/PPSizeCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/base/commands/fun/PPSizeCommand.java b/src/main/java/cc/fascinated/bat/features/base/commands/fun/PPSizeCommand.java index 55c4aad..d90cd3d 100644 --- a/src/main/java/cc/fascinated/bat/features/base/commands/fun/PPSizeCommand.java +++ b/src/main/java/cc/fascinated/bat/features/base/commands/fun/PPSizeCommand.java @@ -9,6 +9,7 @@ import cc.fascinated.bat.model.BatGuild; import cc.fascinated.bat.model.BatUser; import lombok.NonNull; import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel; import net.dv8tion.jda.api.interactions.commands.OptionMapping; import net.dv8tion.jda.api.interactions.commands.OptionType; @@ -34,8 +35,7 @@ public class PPSizeCommand extends BatCommand { public void execute(BatGuild guild, @NonNull BatUser user, @NonNull MessageChannel channel, Member member, @NonNull SlashCommandInteraction event) { OptionMapping userOption = event.getOption("user"); assert userOption != null; // This should never be null - Member targetMember = userOption.getAsMember(); - assert targetMember != null; // This should never be null + User target = userOption.getAsUser(); int size = (int) MathUtils.random(1, 12); event.replyEmbeds(EmbedUtils.genericEmbed() @@ -44,7 +44,7 @@ public class PPSizeCommand extends BatCommand { The size of %s's pp is %s inches **8%sD** """.formatted( - targetMember.getAsMention(), + target.getAsMention(), size, "=".repeat(size) ), false)