From 5e17f655a47ac8e6bb3280bd6d0a392a094173e8 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 15:25:03 +0100 Subject: [PATCH] ples bby gurl --- .../java/cc/fascinated/bat/command/BatCommand.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); } /**