Skip to content

Commit

Permalink
use lavaplayer fork, fix update alerts, fix special case repeat mode …
Browse files Browse the repository at this point in the history
…parse
  • Loading branch information
jagrosh committed Sep 27, 2021
1 parent 7273b5b commit b83028f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@
<artifactId>JDA</artifactId>
<version>4.3.0_324</version>
</dependency>
<dependency>
<!-- using a fork of this to fix some issues faster -->
<!-- dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.78</version>
</dependency>
</dependency -->
<dependency>
<groupId>com.github.jagrosh</groupId>
<artifactId>lavaplayer</artifactId>
<version>jmusicbot-SNAPSHOT</version>
</dependency>
<!-- this is needed, but isn't actually hosted anywhere anymore... uh -->
<!--dependency>
<groupId>com.sedmelluq</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/jagrosh/jmusicbot/Listener.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public void onReady(ReadyEvent event)
{
bot.getThreadpool().scheduleWithFixedDelay(() ->
{
User owner = bot.getJDA().getUserById(bot.getConfig().getOwnerId());
if(owner!=null)
try
{
User owner = bot.getJDA().retrieveUserById(bot.getConfig().getOwnerId()).complete();
String currentVersion = OtherUtil.getCurrentVersion();
String latestVersion = OtherUtil.getLatestVersion();
if(latestVersion!=null && !currentVersion.equalsIgnoreCase(latestVersion))
Expand All @@ -82,6 +82,7 @@ public void onReady(ReadyEvent event)
owner.openPrivateChannel().queue(pc -> pc.sendMessage(msg).queue());
}
}
catch(Exception ex) {} // ignored
}, 0, 24, TimeUnit.HOURS);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public SettingsManager()
JSONObject o = loadedSettings.getJSONObject(id);

// Legacy version support: On versions 0.3.3 and older, the repeat mode was represented as a boolean.
if (o.has("repeat") && o.getBoolean("repeat"))
if (!o.has("repeat_mode") && o.has("repeat") && o.getBoolean("repeat"))
o.put("repeat_mode", RepeatMode.ALL);


Expand Down

0 comments on commit b83028f

Please sign in to comment.