Skip to content

Commit

Permalink
Report unknown members when using the MC verify command
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed May 30, 2024
1 parent 5e89f6c commit af8a45c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public VerifyMCCommand() {
@Override
protected void execute(SlashCommandEvent event) {
final Member target = event.getOption("user", OptionMapping::getAsMember);
assert target != null && event.getGuild() != null && event.getMember() != null;
assert event.getGuild() != null && event.getMember() != null;
if (target == null) {
event.reply("Unknown member!").setEphemeral(true).queue();
return;
}

if (!event.getMember().canInteract(target)) {
event.reply("You cannot interact with that user!").setEphemeral(true).queue();
Expand Down

0 comments on commit af8a45c

Please sign in to comment.