update deps and deal with discords new ratelimits
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -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>
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.dv8tion.jda.core.entities.Guild;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -119,12 +120,13 @@ public class NowplayingHandler
|
||||
{
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user