From 03ae8a8cc13234f6e66db36b82dfe674c0d0eb57 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 25 Jul 2024 12:21:47 +0100 Subject: [PATCH] Encode user input for uuid command Fixes #315 --- .../geysermc/discordbot/commands/FloodgateUuidCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/geysermc/discordbot/commands/FloodgateUuidCommand.java b/src/main/java/org/geysermc/discordbot/commands/FloodgateUuidCommand.java index 8dca5364..0ba5fb73 100644 --- a/src/main/java/org/geysermc/discordbot/commands/FloodgateUuidCommand.java +++ b/src/main/java/org/geysermc/discordbot/commands/FloodgateUuidCommand.java @@ -34,6 +34,8 @@ import org.json.JSONObject; import pw.chew.chewbotcca.util.RestClient; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.UUID; @@ -58,7 +60,7 @@ protected void execute(SlashCommandEvent event) { EmbedBuilder builder = new EmbedBuilder(); builder.setTitle("Floodgate Player UUID"); - RestClient.Response restResponse = RestClient.get("https://api.geysermc.org/v2/xbox/xuid/" + username); + RestClient.Response restResponse = RestClient.get("https://api.geysermc.org/v2/xbox/xuid/" + URLEncoder.encode(username, StandardCharsets.UTF_8)); int serverCode = restResponse.code(); JSONObject response = restResponse.asJSONObject();