Improve registered commands caching
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Discord's API is slow in updating and registering new commands, so we set up a runnable to periodically check.
This commit is contained in:
@@ -125,6 +125,9 @@ public class SlashCommandUtil
|
||||
}
|
||||
|
||||
// cache the registered commands.
|
||||
// note that if this is the first time the bot runs after updating commands,
|
||||
// this will probably still return the previous configuration because the discord api
|
||||
// needs to propagate. this is why we also set up a command updater task (ExpiredMessageTask).
|
||||
Configuration.setRegisteredCommands(jdaInstance.retrieveCommands().complete());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user