Skip to content

Commit 245df46

Browse files
committed
Fix startup logic
1 parent 9d70ec8 commit 245df46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

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

50-
this.setDefaultFailure();
51-
5250
Player tokenManager = this.plugin.getBot().getTokenManager();
5351

5452
this.plugin.getBot().getJDA().retrieveApplicationInfo().queue(applicationInfo -> {
@@ -64,6 +62,8 @@ public void onReady(ReadyEvent event) {
6462

6563
this.setup(tokenManager);
6664
});
65+
66+
this.setDefaultFailure();
6767
}
6868

6969
private void setDefaultFailure() {
@@ -122,10 +122,7 @@ private void setup(Player tokenManager) {
122122

123123
this.plugin.getBot().setDefaultAvatar();
124124
this.plugin.getBot().updateGuild();
125-
this.plugin.getBot().getVoiceChannel().setStatus();
126-
this.plugin.getBot().getVoiceChannel().updatePermissions();
127125
this.plugin.getBot().retrieveMutedUsers();
128-
this.plugin.getBot().updateVoiceState();
129126
this.plugin.getBot().getMenuFactory().loadAll(this.plugin);
130127

131128
this.plugin.getBot().getJDA().getGuilds().forEach(guild -> {
@@ -141,6 +138,9 @@ private void setup(Player tokenManager) {
141138
this.plugin.getListenerManager().registerPermanentBotListeners();
142139
this.plugin.getListenerManager().update();
143140

141+
this.plugin.getBot().getVoiceChannel().setStatus();
142+
this.plugin.getBot().getVoiceChannel().updatePermissions();
143+
this.plugin.getBot().updateVoiceState();
144144
this.plugin.getBot().retrieveProximityChannels();
145145

146146
if (tokenManager == null) {

0 commit comments

Comments
 (0)