From 298e5d365fb5e15f4971355ebfdb9dcfa0b74f1f Mon Sep 17 00:00:00 2001 From: alanx Date: Thu, 6 Oct 2022 23:43:29 -0400 Subject: [PATCH 1/4] Make default permission false by default so that commands default to being usable by everyone --- src/main/java/pw/mihou/velen/builders/VelenCommandBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/pw/mihou/velen/builders/VelenCommandBuilder.java b/src/main/java/pw/mihou/velen/builders/VelenCommandBuilder.java index 0a7597d..aea1e23 100644 --- a/src/main/java/pw/mihou/velen/builders/VelenCommandBuilder.java +++ b/src/main/java/pw/mihou/velen/builders/VelenCommandBuilder.java @@ -31,7 +31,7 @@ public class VelenCommandBuilder { private String name; private final List usages = new ArrayList<>(); private String description; - private boolean defaultPermission = true; + private boolean defaultPermission = false; private VelenSlashEvent velenSlashEvent; private VelenHybridHandler velenHybridHandler; private Duration cooldown; From 30444ef45a0eb5afd7fd130dfd356f967086a4a9 Mon Sep 17 00:00:00 2001 From: alanx Date: Thu, 6 Oct 2022 23:48:54 -0400 Subject: [PATCH 2/4] Bump version number --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32fc9dc..8616923 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pw.mihou Velen - 3.2.0 + 3.2.1 Velen Velen is a command framework for Javacord that aims to do everything simpler and easier. https://github.com/ShindouMihou/Velen/ From 3e73a4b331d891315463821435b63a18a1e4f063 Mon Sep 17 00:00:00 2001 From: alanx Date: Sat, 22 Oct 2022 14:14:57 -0400 Subject: [PATCH 3/4] Update to new Javacord version --- pom.xml | 4 ++-- .../velen/internals/observer/VelenObserver.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 8616923..f7582d8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pw.mihou Velen - 3.2.1 + 3.2.2 Velen Velen is a command framework for Javacord that aims to do everything simpler and easier. https://github.com/ShindouMihou/Velen/ @@ -112,7 +112,7 @@ org.javacord javacord - 3.5.0 + 3.6.0 pom diff --git a/src/main/java/pw/mihou/velen/internals/observer/VelenObserver.java b/src/main/java/pw/mihou/velen/internals/observer/VelenObserver.java index 3130cea..f2fa520 100644 --- a/src/main/java/pw/mihou/velen/internals/observer/VelenObserver.java +++ b/src/main/java/pw/mihou/velen/internals/observer/VelenObserver.java @@ -81,7 +81,7 @@ public CompletableFuture observeServer(Velen velen, Server server) { .filter(s -> s.asSlashCommand().getLeft() != 0L && s.asSlashCommand().getLeft() != null && s.asSlashCommand().getLeft() == server.getId()) .collect(Collectors.toList()); - return server.getSlashCommands().thenAcceptAsync(slashCommands -> commands.forEach(velenCommand -> finalizeServer(server, slashCommands, commands))); + return server.getSlashCommands().thenAcceptAsync(slashCommands -> commands.forEach(velenCommand -> finalizeServer(server, new ArrayList<>(slashCommands), commands))); } /** @@ -126,7 +126,7 @@ public CompletableFuture observeServer(Velen velen, DiscordApi... apis) { + "'s server " + pair.getLeft() + " cannot be found through all " + shards.get(0).getTotalShards() + " shards.")); if (!serverSlashCommands.containsKey(pair.getLeft())) { - serverSlashCommands.put(pair.getLeft(), api.getServerSlashCommands(server).join()); + serverSlashCommands.put(pair.getLeft(), new ArrayList<>(api.getServerSlashCommands(server).join())); } List slashCommands = serverSlashCommands.get(pair.getLeft()); @@ -151,8 +151,10 @@ public CompletableFuture observe(Velen velen) { return api.getGlobalSlashCommands().thenAcceptAsync(slashCommands -> { + List slashCommandList = new ArrayList<>(slashCommands); + if (mode.isCreate()) { - existentialFilter(commands, slashCommands).forEach(command -> { + existentialFilter(commands, slashCommandList).forEach(command -> { long start = System.currentTimeMillis(); command.asSlashCommand().getRight().createGlobal(api).thenAccept(slashCommand -> logger.info("Application command was created. [name={}, description={}, id={}]. It took {} milliseconds.", slashCommand.getName(), slashCommand.getDescription(), @@ -162,7 +164,7 @@ public CompletableFuture observe(Velen velen) { } if (mode.isUpdate()) { - crustFilter(commands, slashCommands).forEach((aLong, velenCommand) -> { + crustFilter(commands, slashCommandList).forEach((aLong, velenCommand) -> { long start = System.currentTimeMillis(); velenCommand.asSlashCommandUpdater(aLong).getRight().updateGlobal(api) @@ -173,8 +175,8 @@ public CompletableFuture observe(Velen velen) { } if (!mode.isUpdate() && !mode.isCreate()) { - existentialFilter(commands, slashCommands).forEach(command -> logger.warn("Application command is not registered on Discord API. [{}]", command.toString())); - crustFilter(commands, slashCommands).forEach((aLong, velenCommand) -> + existentialFilter(commands, slashCommandList).forEach(command -> logger.warn("Application command is not registered on Discord API. [{}]", command.toString())); + crustFilter(commands, slashCommandList).forEach((aLong, velenCommand) -> logger.warn("Application command requires updating. [id={}, {}]", aLong, velenCommand.toString())); } From 5b7fa27e045fcf9053268c975b8f8123de466902 Mon Sep 17 00:00:00 2001 From: alanx Date: Sun, 15 Jan 2023 11:31:56 -0500 Subject: [PATCH 4/4] Uodate Javacord version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f7582d8..fcc93ba 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pw.mihou Velen - 3.2.2 + 3.2.3 Velen Velen is a command framework for Javacord that aims to do everything simpler and easier. https://github.com/ShindouMihou/Velen/ @@ -112,7 +112,7 @@ org.javacord javacord - 3.6.0 + 3.7.0 pom