diff --git a/pom.xml b/pom.xml
index bc5363c..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
@@ -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..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
@@ -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 29347ca..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
@@ -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
+
+
@@ -45,7 +78,8 @@
com.github.austinv11
Discord4j
- 2.9.2
+ 2.9.3
+ provided
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..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) {
@@ -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();
diff --git a/sdcf4j-javacord/pom.xml b/sdcf4j-javacord/pom.xml
index 2e07441..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
@@ -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
+
+
@@ -44,7 +77,8 @@
de.btobastian
Javacord
- 6f357bc
+ 8ded4aa
+ provided
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..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
@@ -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) {
@@ -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);
}
diff --git a/sdcf4j-jda3/pom.xml b/sdcf4j-jda3/pom.xml
index e055747..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
@@ -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
+
+
@@ -46,7 +79,8 @@
net.dv8tion
JDA
- 3.3.1_304
+ 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 c6b41d6..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
@@ -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.
@@ -88,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("[\\s&&[^\\n]]++");
String commandString = splitMessage[0];
SimpleCommand command = commands.get(commandString.toLowerCase());
if (command == null) {
@@ -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;
}