From a460a201e14ea237cd00e0b221c1ce0efa06f419 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 9 Jan 2023 09:07:40 -0500 Subject: [PATCH] Logging string contains exec command. --- src/discord/handlers/DevRequestHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/discord/handlers/DevRequestHandler.java b/src/discord/handlers/DevRequestHandler.java index 982e3be4..c45b72d6 100644 --- a/src/discord/handlers/DevRequestHandler.java +++ b/src/discord/handlers/DevRequestHandler.java @@ -12,7 +12,9 @@ import discord.MagicBot; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import org.pmw.tinylog.Logger; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStreamReader; public class DevRequestHandler { @@ -21,6 +23,8 @@ public class DevRequestHandler { String serverCommand; String commandArgument = ""; String commandString = ""; + String logString = ""; + ProcessBuilder processBuilder; // Early exit if database unavailable or is not an admin @@ -64,7 +68,7 @@ public class DevRequestHandler { Logger.info(e.toString()); } - MagicBot.sendResponse(event, "Executed on dev: " + serverCommand + " " + commandArgument); - Logger.info(event.getAuthor().getName() + " told dev to " + serverCommand + " " + commandArgument); + logString = String.join(" ",processBuilder.command().toArray(new String[0])); + MagicBot.sendResponse(event, "Executed on dev: " + logString); } } \ No newline at end of file