Skip to content

Commit

Permalink
Updated to JDA 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kantenkugel committed Jan 21, 2018
1 parent 39191e3 commit 4c809d4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
# intellij #
/.idea/
*.iml
/out/

## eclipse ##
/bin/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -81,7 +81,7 @@ repositories {
}

dependencies {
compile 'net.dv8tion:JDA:3.3.0_264'
compile 'net.dv8tion:JDA:3.5.0_329'
compile 'com.sedmelluq:lavaplayer:1.2.43'
compile 'net.lingala.zip4j:zip4j:1.3.2'
compile 'com.google.code.gson:gson:2.8.1'
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/dv8tion/discord/Permissions.java
Expand Up @@ -93,6 +93,7 @@ public void setBotAsOp(SelfUser bot)
* true - if the user was successfully added.
* false - if the user was already an OP.
* @throws SQLException
* in case of sql update failing
*/
public Boolean addOp(String userId) throws SQLException
{
Expand All @@ -116,6 +117,8 @@ public Boolean addOp(String userId) throws SQLException
* @return
* true - if the user was successfully removed.
* false - if the user was not an op.
* @throws SQLException
* in case of sql update failing
*/
public boolean removeOp(String userId) throws SQLException
{
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/net/dv8tion/discord/Yui.java
Expand Up @@ -200,11 +200,6 @@ private static void setupBot()
System.out.println("Our login thread was interrupted!");
System.exit(UNABLE_TO_CONNECT_TO_DISCORD);
}
catch (RateLimitedException e)
{
System.out.println("Encountered ratelimit while attempting to login!");
System.exit(UNABLE_TO_CONNECT_TO_DISCORD);
}
}

private static void relaunchInUTF8() throws InterruptedException, UnsupportedEncodingException
Expand Down
Expand Up @@ -110,7 +110,7 @@ public Message getDiscordMessage()

public void setDiscordMessage(Message discordMessage)
{
String parsedMessage = discordMessage.getContent();
String parsedMessage = discordMessage.getContentDisplay();
for (Message.Attachment attach : discordMessage.getAttachments())
{
parsedMessage += "\n" + attach.getUrl();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/dv8tion/discord/commands/Command.java
Expand Up @@ -47,7 +47,7 @@ protected boolean containsCommand(Message message)

protected String[] commandArgs(Message message)
{
return commandArgs(message.getContent());
return commandArgs(message.getContentDisplay());
}

protected String[] commandArgs(String string)
Expand Down
Expand Up @@ -81,7 +81,7 @@ public void onCommand(MessageReceivedEvent e, String[] args)
Object out = engine.eval(
"(function() {" +
"with (imports) {" +
e.getMessage().getContent().substring(args[0].length()) +
e.getMessage().getContentDisplay().substring(args[0].length()) +
"}" +
"})();");
sendMessage(e, out == null ? "Executed without error." : out.toString());
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void onCommand(MessageReceivedEvent e, String[] args)
.append("**Improper syntax, unrecognized permission group:** ")
.append(args[0])
.append("\n**Provided Command:** ")
.append(e.getMessage().getContent())
.append(e.getMessage().getContentDisplay())
.build());
return;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ private void processOp(MessageReceivedEvent e, String[] args)
.append("**Improper syntax, unrecognized argument:** ")
.append(args[1])
.append("\n**Provided Command:** ")
.append(e.getMessage().getContent())
.append(e.getMessage().getContentDisplay())
.build());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/dv8tion/discord/music/PlayerControl.java
Expand Up @@ -92,7 +92,7 @@ public void onMessageReceived(MessageReceivedEvent event)
//In that case, we treat the music system as not having admin restrictions.
}

String[] command = event.getMessage().getContent().split(" ", 2);
String[] command = event.getMessage().getContentDisplay().split(" ", 2);
if (!command[0].startsWith(".")) //message doesn't start with prefix.
return;

Expand Down

0 comments on commit 4c809d4

Please sign in to comment.