From 8ecd4f504d9e91514634f0171d12902325a941bb Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Mon, 6 Aug 2018 12:24:42 +0200 Subject: [PATCH] Fixed requiresMention not working --- .../java/de/btobastian/sdcf4j/handler/Discord4JHandler.java | 2 +- .../main/java/de/btobastian/sdcf4j/handler/JavacordHandler.java | 2 +- .../src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdcf4j-discord4j/src/main/java/de/btobastian/sdcf4j/handler/Discord4JHandler.java b/sdcf4j-discord4j/src/main/java/de/btobastian/sdcf4j/handler/Discord4JHandler.java index 57e6264..dbbad16 100644 --- a/sdcf4j-discord4j/src/main/java/de/btobastian/sdcf4j/handler/Discord4JHandler.java +++ b/sdcf4j-discord4j/src/main/java/de/btobastian/sdcf4j/handler/Discord4JHandler.java @@ -98,7 +98,7 @@ private void handleMessageCreate(final MessageReceivedEvent event) { Command commandAnnotation = command.getCommandAnnotation(); if (commandAnnotation.requiresMention()) { Matcher matcher = USER_MENTION.matcher(commandString); - if (!matcher.find() || matcher.group("id").equals(event.getClient().getOurUser().getStringID())) { + if (!matcher.find() || !matcher.group("id").equals(event.getClient().getOurUser().getStringID())) { return; } } diff --git a/sdcf4j-javacord/src/main/java/de/btobastian/sdcf4j/handler/JavacordHandler.java b/sdcf4j-javacord/src/main/java/de/btobastian/sdcf4j/handler/JavacordHandler.java index 789f509..5e62e07 100644 --- a/sdcf4j-javacord/src/main/java/de/btobastian/sdcf4j/handler/JavacordHandler.java +++ b/sdcf4j-javacord/src/main/java/de/btobastian/sdcf4j/handler/JavacordHandler.java @@ -110,7 +110,7 @@ private void handleMessageCreate(DiscordApi api, final MessageCreateEvent event) Command commandAnnotation = command.getCommandAnnotation(); if (commandAnnotation.requiresMention()) { Matcher matcher = USER_MENTION.matcher(commandString); - if (!matcher.find() || matcher.group("id").equals(api.getYourself().getIdAsString())) { + if (!matcher.find() || !matcher.group("id").equals(api.getYourself().getIdAsString())) { return; } } diff --git a/sdcf4j-jda3/src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java b/sdcf4j-jda3/src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java index 276d0b9..2ce3e0a 100644 --- a/sdcf4j-jda3/src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java +++ b/sdcf4j-jda3/src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java @@ -109,7 +109,7 @@ private void handleMessageCreate(final MessageReceivedEvent event) { Command commandAnnotation = command.getCommandAnnotation(); if (commandAnnotation.requiresMention()) { Matcher matcher = USER_MENTION.matcher(commandString); - if (!matcher.find() || matcher.group("id").equals(jda.getSelfUser().getId())) { + if (!matcher.find() || !matcher.group("id").equals(jda.getSelfUser().getId())) { return; } }