Skip to content

Commit

Permalink
update deps and deal with discords new ratelimits
Browse files Browse the repository at this point in the history
  • Loading branch information
jagrosh committed May 30, 2020
1 parent f1e301b commit c5a583b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.46</version>
<version>1.3.49</version>
</dependency>
<dependency>
<groupId>com.sedmelluq</groupId>
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/jagrosh/jmusicbot/audio/NowplayingHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.exceptions.PermissionException;
import net.dv8tion.jda.core.exceptions.RateLimitedException;

/**
*
Expand Down Expand Up @@ -119,12 +120,13 @@ else if(tchan.getTopic().contains("\u200B"))
{
try
{
if(wait)
tchan.getManager().setTopic(text).complete();
else
tchan.getManager().setTopic(text).queue();
// normally here if 'wait' was false, we'd want to queue, however,
// new discord ratelimits specifically limiting changing channel topics
// mean we don't want a backlog of changes piling up, so if we hit a
// ratelimit, we just won't change the topic this time
tchan.getManager().setTopic(text).complete(wait);
}
catch(PermissionException ignore) {}
catch(PermissionException | RateLimitedException ignore) {}
}
}
}
Expand Down

0 comments on commit c5a583b

Please sign in to comment.