Set isVisible to default to true

java-rewrite
Hammy 3 years ago
parent be9d51420a
commit ebefe3f991

@ -17,7 +17,7 @@ import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
import net.dv8tion.jda.api.interactions.commands.OptionType;
@SlashCommand(name = "avatar", description = "Display your avatar", isVisible = true)
@SlashCommand(name = "avatar", description = "Display your avatar")
public class Avatar {
private final EmbedService embedService;
private final ImageService imageService;

@ -7,7 +7,7 @@ import me.goudham.service.EmbedService;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.events.interaction.SlashCommandEvent;
@SlashCommand(name = "ping", description = "Display the latency of the bot", isVisible = true)
@SlashCommand(name = "ping", description = "Display the latency of the bot")
public class Ping {
private final EmbedService embedService;

@ -113,7 +113,7 @@ public class SlashCommandLoader implements CommandLoader {
if (slashCommand != null) {
String name = slashCommand.stringValue("name").orElseThrow();
String description = slashCommand.stringValue("description").orElseThrow();
boolean isVisible = slashCommand.booleanValue("isVisible").orElseThrow();
boolean isVisible = slashCommand.booleanValue("isVisible").orElse(true);
String[] subCommandGroups = slashCommand.stringValues("subCommandGroups");
CommandData commandData = new CommandData(name, description).setDefaultEnabled(isVisible);

@ -16,7 +16,7 @@ import java.lang.annotation.Target;
public @interface SlashCommand {
String name();
String description();
boolean isVisible();
boolean isVisible() default true;
String[] subCommandGroups() default {};
Option[] options() default {};
}

Loading…
Cancel
Save