Fix console spam if lack scope

This commit is contained in:
unknown 2022-03-31 22:45:26 -07:00
parent f210240bd5
commit a8d89e149c
1 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.exceptions.ContextException;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.OptionData;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
@ -244,7 +245,12 @@ public class Kiafumi {
}
//Push w/ modifications.
info("Command: " + ci.getName() + " registration on " + guild.getId() + " completed.");
cca.queue();
try {
cca.queue();
} catch (Exception ex) {
//Only time this *should* occur is in the event of a server not having the proper scope.
error("Failed to queue command for RestAction, not printing stack to avoid console spam.");
}
}
}
info("Registered " + i + " commands.");