return a msg if it's not your cancel request

This commit is contained in:
Lee 2024-07-04 01:04:38 +01:00
parent 7083bebef1
commit 0a80db8195
2 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,6 @@ public class RequestSubCommand extends BatSubCommand implements EventListener {
}
VoiceChannel targetChannel = targetVoiceState.getChannel().asVoiceChannel();
// User is already in the target channel
if (voiceState.getChannel().getId().equals(targetChannel.getId())) {
event.replyEmbeds(EmbedUtils.errorEmbed()

View File

@ -27,6 +27,9 @@ public class RequestListener implements EventListener {
.filter(request -> request.getMember().getId().equals(event.getUser().getId()))
.findFirst();
if (optionalDragRequest.isEmpty()) {
event.replyEmbeds(EmbedUtils.errorEmbed()
.setDescription("You do not have a request to cancel.")
.build()).queue();
return;
}
DragRequest dragRequest = optionalDragRequest.get();