General Troubleshooting
Feature Request
Add a custom .equals method for CommandData and OptionData. This .equals method would check if the two commands are pretty much the same.
It would do this by comparing the name, description, type (for options), required? (for options) and OptionData list (for commands).
Example Use-Case
// Snippet of code that *could* work
LOGGER.info("Got existing commands");
for (Command discordCommand : registeredCommands) {
SlashCommandData discordCommandData = SlashCommandData.fromCommand(discordCommand);
if (!commands.remove(discordCommandData)) {
if (commands.stream().noneMatch(command -> command.getName().equals(discordCommand.getName()))) {
discordCommand.delete().queue();
LOGGER.info("Sent request to delete no longer existing command {}", discordCommand.getName());
}
} else {
LOGGER.info("Command {} already up to date", discordCommand.getName());
}
}
for (CommandData command : commands) {
guild.upsertCommand(command).queue();
LOGGER.info("Sent request to upsert command {}", command.getName());
}
LOGGER.info("Updated all commands");
General Troubleshooting
Feature Request
Add a custom .equals method for CommandData and OptionData. This .equals method would check if the two commands are pretty much the same.
It would do this by comparing the name, description, type (for options), required? (for options) and OptionData list (for commands).
Example Use-Case