Skip to content

Commit 9d70ec8

Browse files
committed
Fix permission error
1 parent f4e36ef commit 9d70ec8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/java/net/clementraynaud/skoice/bot/BotVoiceChannel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public VoiceChannel getVoiceChannel() {
5656
}
5757

5858
public void setStatus() {
59-
if (this.plugin.getBot().isAdministrator()) {
59+
if (!this.plugin.getBot().isAdministrator()) {
6060
return;
6161
}
6262
VoiceChannel voiceChannel = this.getVoiceChannel();

src/main/java/net/clementraynaud/skoice/listeners/session/ReadyListener.java

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public ReadyListener(Skoice plugin) {
4747
@Override
4848
public void onReady(ReadyEvent event) {
4949

50+
this.setDefaultFailure();
51+
5052
Player tokenManager = this.plugin.getBot().getTokenManager();
5153

5254
this.plugin.getBot().getJDA().retrieveApplicationInfo().queue(applicationInfo -> {
@@ -62,7 +64,9 @@ public void onReady(ReadyEvent event) {
6264

6365
this.setup(tokenManager);
6466
});
67+
}
6568

69+
private void setDefaultFailure() {
6670
Consumer<? super Throwable> defaultFailure = RestAction.getDefaultFailure();
6771
RestAction.setDefaultFailure(throwable -> {
6872
if (throwable instanceof ErrorResponseException) {

0 commit comments

Comments
 (0)