Remove redundant API command fetcher
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:
2022-11-22 14:53:46 +01:00
parent 526880e1f1
commit 244e8ace76
6 changed files with 22 additions and 68 deletions

View File

@@ -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!");
}
}