File tree Expand file tree Collapse file tree
application/src/main/java/org/togetherjava/tjbot/commands/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ public void onReady(@NotNull ReadyEvent event) {
7676 // Register reload on all guilds
7777 logger .debug ("JDA is ready, registering reload command" );
7878 event .getJDA ().getGuildCache ().forEach (this ::registerReloadCommand );
79+ // NOTE We do not have to wait for reload to complete for the command system to be ready
80+ // itself
7981 logger .debug ("Command system is now ready" );
8082 }
8183
@@ -104,12 +106,16 @@ private void registerReloadCommand(@NotNull Guild guild) {
104106 guild .retrieveCommands ().queue (commands -> {
105107 // Has it been registered already?
106108 if (commands .stream ().map (Command ::getName ).anyMatch (RELOAD_COMMAND ::equals )) {
109+ logger .debug ("Command '{}' has already been registered for guild '{}'" ,
110+ RELOAD_COMMAND , guild .getName ());
107111 return ;
108112 }
109113
110114 logger .debug ("Register '{}' for guild '{}'" , RELOAD_COMMAND , guild .getName ());
111115 SlashCommand reloadCommand = requireSlashCommand (RELOAD_COMMAND );
112- guild .upsertCommand (reloadCommand .getData ()).queue ();
116+ guild .upsertCommand (reloadCommand .getData ())
117+ .queue (command -> logger .debug ("Registered '{}' for guild '{}'" , RELOAD_COMMAND ,
118+ guild .getName ()));
113119 });
114120 }
115121
You can’t perform that action at this time.
0 commit comments