From 95d11279389065a7868e59d517fbed598ab52f40 Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Thu, 14 Dec 2017 19:30:13 +0100 Subject: [PATCH 1/9] Added "provided" scope to the library dependencies --- sdcf4j-discord4j/pom.xml | 1 + sdcf4j-javacord/pom.xml | 1 + sdcf4j-jda3/pom.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/sdcf4j-discord4j/pom.xml b/sdcf4j-discord4j/pom.xml index 29347ca..de515ce 100644 --- a/sdcf4j-discord4j/pom.xml +++ b/sdcf4j-discord4j/pom.xml @@ -46,6 +46,7 @@ com.github.austinv11 Discord4j 2.9.2 + provided diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml index 2e07441..6e56a03 100644 --- a/sdcf4j-javacord/pom.xml +++ b/sdcf4j-javacord/pom.xml @@ -45,6 +45,7 @@ de.btobastian Javacord 6f357bc + provided diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml index e055747..4dab920 100644 --- a/sdcf4j-jda3/pom.xml +++ b/sdcf4j-jda3/pom.xml @@ -47,6 +47,7 @@ net.dv8tion JDA 3.3.1_304 + provided From a82da9edfdc27814684ce82be8906d3c2c353c67 Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Sun, 24 Dec 2017 10:52:19 +0100 Subject: [PATCH 2/9] Updated dependencies of all 3 libraries --- sdcf4j-discord4j/pom.xml | 2 +- sdcf4j-javacord/pom.xml | 2 +- sdcf4j-jda3/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdcf4j-discord4j/pom.xml b/sdcf4j-discord4j/pom.xml index de515ce..8b281b3 100644 --- a/sdcf4j-discord4j/pom.xml +++ b/sdcf4j-discord4j/pom.xml @@ -45,7 +45,7 @@ com.github.austinv11 Discord4j - 2.9.2 + 2.9.3 provided diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml index 6e56a03..5caac76 100644 --- a/sdcf4j-javacord/pom.xml +++ b/sdcf4j-javacord/pom.xml @@ -44,7 +44,7 @@ de.btobastian Javacord - 6f357bc + bf9814e provided diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml index 4dab920..75b155a 100644 --- a/sdcf4j-jda3/pom.xml +++ b/sdcf4j-jda3/pom.xml @@ -46,7 +46,7 @@ net.dv8tion JDA - 3.3.1_304 + 3.4.0_318 provided From 332f1446d1c765b4a97b4c22a053465238e3f028 Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Sun, 24 Dec 2017 10:59:13 +0100 Subject: [PATCH 3/9] JavaDocs and Sources are now included (fixes #22) --- pom.xml | 33 +++++++++++++++++++++++++++++++++ sdcf4j-core/pom.xml | 33 +++++++++++++++++++++++++++++++++ sdcf4j-discord4j/pom.xml | 33 +++++++++++++++++++++++++++++++++ sdcf4j-javacord/pom.xml | 33 +++++++++++++++++++++++++++++++++ sdcf4j-jda3/pom.xml | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+) diff --git a/pom.xml b/pom.xml index bc5363c..0481763 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,39 @@ 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.2 + + + attach-javadocs + + jar + + + + + java + + diff --git a/sdcf4j-core/pom.xml b/sdcf4j-core/pom.xml index f88d3af..a385198 100644 --- a/sdcf4j-core/pom.xml +++ b/sdcf4j-core/pom.xml @@ -23,6 +23,39 @@ 1.7 + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.2 + + + attach-javadocs + + jar + + + + + java + + diff --git a/sdcf4j-discord4j/pom.xml b/sdcf4j-discord4j/pom.xml index 8b281b3..70939ec 100644 --- a/sdcf4j-discord4j/pom.xml +++ b/sdcf4j-discord4j/pom.xml @@ -23,6 +23,39 @@ 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.2 + + + attach-javadocs + + jar + + + + + java + + diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml index 5caac76..c6be283 100644 --- a/sdcf4j-javacord/pom.xml +++ b/sdcf4j-javacord/pom.xml @@ -23,6 +23,39 @@ 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.2 + + + attach-javadocs + + jar + + + + + java + + diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml index 75b155a..01ebee0 100644 --- a/sdcf4j-jda3/pom.xml +++ b/sdcf4j-jda3/pom.xml @@ -23,6 +23,39 @@ 1.8 + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.2 + + + attach-javadocs + + jar + + + + + java + + From e1d69256735168bc77dd0abbe600aaead41154dc Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Sun, 24 Dec 2017 11:13:53 +0100 Subject: [PATCH 4/9] Fixed missing #queue() call on "missing permission" message in JDA3Handler --- .../main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 c6b41d6..be22b6e 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 @@ -32,6 +32,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; +import java.util.Collection; /** * A command handler for the JDA library. @@ -116,7 +117,7 @@ private void handleMessageCreate(final MessageReceivedEvent event) { } if (!hasPermission(event.getAuthor(), commandAnnotation.requiredPermissions())) { if (Sdcf4jMessage.MISSING_PERMISSIONS.getMessage() != null) { - event.getChannel().sendMessage(Sdcf4jMessage.MISSING_PERMISSIONS.getMessage()); + event.getChannel().sendMessage(Sdcf4jMessage.MISSING_PERMISSIONS.getMessage()).queue(); } return; } From b58ded144543af618b8ecae5f9a69a19c19b2b6b Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Sun, 24 Dec 2017 11:17:35 +0100 Subject: [PATCH 5/9] Replaced an anonymous class with lambda expression in Discord4J handler --- .../de/btobastian/sdcf4j/handler/Discord4JHandler.java | 7 ++----- 1 file changed, 2 insertions(+), 5 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 9139ef2..2e3f0b6 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 @@ -121,11 +121,8 @@ private void handleMessageCreate(final MessageReceivedEvent event) { final Object[] parameters = getParameters(splitMessage, command, event); if (commandAnnotation.async()) { final SimpleCommand commandFinal = command; - Thread t = new Thread(new Runnable() { - @Override - public void run() { - invokeMethod(commandFinal, event, parameters); - } + Thread t = new Thread(() -> { + invokeMethod(commandFinal, event, parameters); }); t.setDaemon(true); t.start(); From 68b956b61ebcb1e031fd10bb5a08c88e47760ec5 Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Tue, 16 Jan 2018 11:31:41 +0100 Subject: [PATCH 6/9] Updated dependencies (fixes #35) --- sdcf4j-javacord/pom.xml | 2 +- sdcf4j-jda3/pom.xml | 2 +- .../src/main/java/de/btobastian/sdcf4j/handler/JDA3Handler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml index c6be283..e4debd2 100644 --- a/sdcf4j-javacord/pom.xml +++ b/sdcf4j-javacord/pom.xml @@ -77,7 +77,7 @@ de.btobastian Javacord - bf9814e + 8ded4aa provided diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml index 01ebee0..b31ff62 100644 --- a/sdcf4j-jda3/pom.xml +++ b/sdcf4j-jda3/pom.xml @@ -79,7 +79,7 @@ net.dv8tion JDA - 3.4.0_318 + 3.5.0_327 provided 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 be22b6e..3778d4c 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 @@ -89,7 +89,7 @@ private void handleMessageCreate(final MessageReceivedEvent event) { if (event.getAuthor() == jda.getSelfUser()) { return; } - String[] splitMessage = event.getMessage().getRawContent().split(" "); + String[] splitMessage = event.getMessage().getContentRaw().split(" "); String commandString = splitMessage[0]; SimpleCommand command = commands.get(commandString.toLowerCase()); if (command == null) { From 80e63ca27d2faf644092dd18795175bf2b300dd6 Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Tue, 16 Jan 2018 12:01:54 +0100 Subject: [PATCH 7/9] Improved message splitting (fixes #30) --- .../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 2e3f0b6..facaa2e 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 @@ -83,7 +83,7 @@ public boolean hasPermission(IUser user, String permission) { * @param event The MessageReceivedEvent. */ private void handleMessageCreate(final MessageReceivedEvent event) { - String[] splitMessage = event.getMessage().getContent().split(" "); + String[] splitMessage = event.getMessage().getContent().split("[\\s&&[^\\n]]++"); String commandString = splitMessage[0]; SimpleCommand command = commands.get(commandString.toLowerCase()); if (command == null) { 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 ec36d24..eefa027 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 @@ -83,7 +83,7 @@ private void handleMessageCreate(DiscordApi api, final Message message) { if (message.getUserAuthor().map(User::isYourself).orElse(false)) { return; } - String[] splitMessage = message.getContent().split(" "); + String[] splitMessage = message.getContent().split("[\\s&&[^\\n]]++"); String commandString = splitMessage[0]; SimpleCommand command = commands.get(commandString.toLowerCase()); if (command == null) { 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 3778d4c..7bd73ed 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 @@ -89,7 +89,7 @@ private void handleMessageCreate(final MessageReceivedEvent event) { if (event.getAuthor() == jda.getSelfUser()) { return; } - String[] splitMessage = event.getMessage().getContentRaw().split(" "); + String[] splitMessage = event.getMessage().getContentRaw().split("[\\s&&[^\\n]]++"); String commandString = splitMessage[0]; SimpleCommand command = commands.get(commandString.toLowerCase()); if (command == null) { From b4559b3d699e236b7f2c8bfb3c077f976190bc3b Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Tue, 16 Jan 2018 12:03:35 +0100 Subject: [PATCH 8/9] Replaced an anonymous class with a lambda expression --- .../java/de/btobastian/sdcf4j/handler/JavacordHandler.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 eefa027..f8dd3ce 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 @@ -118,12 +118,7 @@ private void handleMessageCreate(DiscordApi api, final Message message) { final Object[] parameters = getParameters(splitMessage, command, message, api); if (commandAnnotation.async()) { final SimpleCommand commandFinal = command; - api.getThreadPool().getExecutorService().submit(new Runnable() { - @Override - public void run() { - invokeMethod(commandFinal, message, parameters); - } - }); + api.getThreadPool().getExecutorService().submit(() -> invokeMethod(commandFinal, message, parameters)); } else { invokeMethod(command, message, parameters); } From 8f569ee5dc36be09c6595c12833d109b7127c23e Mon Sep 17 00:00:00 2001 From: BtoBastian Date: Tue, 16 Jan 2018 12:05:15 +0100 Subject: [PATCH 9/9] Incremented version number --- pom.xml | 2 +- sdcf4j-core/pom.xml | 2 +- sdcf4j-discord4j/pom.xml | 2 +- sdcf4j-javacord/pom.xml | 2 +- sdcf4j-jda3/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 0481763..35460c9 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ de.btobastian.sdcf4j sdcf4j pom - 1.0.8 + 1.0.9 UTF-8 diff --git a/sdcf4j-core/pom.xml b/sdcf4j-core/pom.xml index a385198..eefb03b 100644 --- a/sdcf4j-core/pom.xml +++ b/sdcf4j-core/pom.xml @@ -5,7 +5,7 @@ sdcf4j de.btobastian.sdcf4j - 1.0.8 + 1.0.9 jar 4.0.0 diff --git a/sdcf4j-discord4j/pom.xml b/sdcf4j-discord4j/pom.xml index 70939ec..024b2ba 100644 --- a/sdcf4j-discord4j/pom.xml +++ b/sdcf4j-discord4j/pom.xml @@ -5,7 +5,7 @@ sdcf4j de.btobastian.sdcf4j - 1.0.8 + 1.0.9 jar 4.0.0 diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml index e4debd2..9033baa 100644 --- a/sdcf4j-javacord/pom.xml +++ b/sdcf4j-javacord/pom.xml @@ -5,7 +5,7 @@ sdcf4j de.btobastian.sdcf4j - 1.0.8 + 1.0.9 jar 4.0.0 diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml index b31ff62..d03202d 100644 --- a/sdcf4j-jda3/pom.xml +++ b/sdcf4j-jda3/pom.xml @@ -5,7 +5,7 @@ sdcf4j de.btobastian.sdcf4j - 1.0.8 + 1.0.9 jar 4.0.0