Remove redundant API command fetcher
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
We have our own command listener now, so we don't need to rely on Discord's slow API.
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package wtf.beatrice.hidekobot.runnables;
|
||||
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import wtf.beatrice.hidekobot.Cache;
|
||||
import wtf.beatrice.hidekobot.HidekoBot;
|
||||
import wtf.beatrice.hidekobot.util.Logger;
|
||||
|
||||
public class CommandsUpdateTask implements Runnable {
|
||||
|
||||
private final Logger logger;
|
||||
|
||||
public CommandsUpdateTask()
|
||||
{
|
||||
logger = new Logger(getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if(Cache.isVerbose()) logger.log("Refreshing commands cache...");
|
||||
JDA instance = HidekoBot.getAPI();
|
||||
if(instance == null) return;
|
||||
Cache.setRegisteredCommands(instance.retrieveCommands().complete());
|
||||
if(Cache.isVerbose()) logger.log("Commands cache refreshed!");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user