@@ -70,6 +70,7 @@ public class Bot {
70
70
private final MenuFactory menuFactory ;
71
71
private JDA jda ;
72
72
private BotStatus status = BotStatus .NOT_CONNECTED ;
73
+ private boolean isStatusChecked = false ;
73
74
private String tokenManagerId ;
74
75
private String guildId ;
75
76
private String inviteUrl ;
@@ -89,6 +90,7 @@ public void connect() {
89
90
90
91
public void connect (CommandSender sender ) {
91
92
if (!this .plugin .getConfigYamlFile ().contains (ConfigField .TOKEN .toString ())) {
93
+ this .isStatusChecked = true ;
92
94
this .plugin .getLogger ().warning (this .plugin .getLang ().getMessage ("logger.warning.no-token" ));
93
95
return ;
94
96
}
@@ -121,6 +123,7 @@ public void connect(CommandSender sender) {
121
123
.addEventListeners (new ReadyListener (this .plugin ))
122
124
.build ();
123
125
} catch (InvalidTokenException | IllegalArgumentException | ErrorResponseException e ) {
126
+ this .isStatusChecked = true ;
124
127
this .plugin .getLogger ().warning (this .plugin .getLang ().getMessage ("logger.error.bot-could-not-connect" ));
125
128
this .plugin .getConfigYamlFile ().remove (ConfigField .TOKEN .toString ());
126
129
if (tokenManager != null ) {
@@ -262,6 +265,7 @@ public void updateStatus() {
262
265
}
263
266
}
264
267
268
+ this .isStatusChecked = true ;
265
269
this .updateActivity ();
266
270
}
267
271
}
@@ -276,6 +280,10 @@ public void updateActivity() {
276
280
}
277
281
278
282
public void sendIncompleteConfigurationAlert (Player player , boolean sendIfPermissionMissing , boolean force ) {
283
+ if (!this .isStatusChecked ) {
284
+ return ;
285
+ }
286
+
279
287
if (player .hasPermission (Argument .MANAGE_PERMISSION ) || force ) {
280
288
if (this .status == BotStatus .NOT_CONNECTED ) {
281
289
if (this .plugin .getConfigYamlFile ().getBoolean (ConfigField .TOOLTIPS .toString ())) {
0 commit comments