diff --git a/src/main/java/cc/fascinated/bat/command/BatCommand.java b/src/main/java/cc/fascinated/bat/command/BatCommand.java index f18ba97..e66d8f8 100644 --- a/src/main/java/cc/fascinated/bat/command/BatCommand.java +++ b/src/main/java/cc/fascinated/bat/command/BatCommand.java @@ -64,10 +64,15 @@ public abstract class BatCommand { if (info.isUserInstall()) { integrationTypes.add(IntegrationType.USER_INSTALL); } + List contextTypes = new ArrayList<>(); + if (info.isGuildOnly()) { + contextTypes.add(InteractionContextType.GUILD); + } else { + contextTypes.addAll(List.of(InteractionContextType.values())); + } commandData = new CommandDataImpl(info.getName(), info.getDescription()) - .setContexts(InteractionContextType.ALL) - .setIntegrationTypes(integrationTypes) - .setGuildOnly(!getInfo().isUserInstall() && getInfo().isGuildOnly()); + .setContexts(contextTypes) + .setIntegrationTypes(integrationTypes); } /**