From 839ec527df2946dac3f93bcff2f3796fe1e8bec1 Mon Sep 17 00:00:00 2001 From: Toastie Date: Thu, 26 Dec 2024 20:22:05 +1300 Subject: [PATCH] Made interview command responses ephemeral --- Commands/AdminCommands.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Commands/AdminCommands.cs b/Commands/AdminCommands.cs index 442407d..8c1beed 100644 --- a/Commands/AdminCommands.cs +++ b/Commands/AdminCommands.cs @@ -229,7 +229,7 @@ public class AdminCommands public async Task GetInterviewTemplates(SlashCommandContext command) { MemoryStream stream = new(Encoding.UTF8.GetBytes(Database.GetInterviewTemplatesJSON())); - await command.RespondAsync(new DiscordInteractionResponseBuilder().AddFile("interview-templates.json", stream)); + await command.RespondAsync(new DiscordInteractionResponseBuilder().AddFile("interview-templates.json", stream).AsEphemeral()); } [Command("setinterviewtemplates")] @@ -240,10 +240,9 @@ public class AdminCommands { await command.RespondAsync(new DiscordEmbedBuilder { - Color = DiscordColor.Red, Description = "The uploaded file is not a JSON file according to Discord." - }); + }, true); return; } @@ -293,11 +292,12 @@ public class AdminCommands { Text = "More detailed information may be available as debug messages in the bot logs." } - }); + }, true); return; } Database.SetInterviewTemplates(JsonConvert.SerializeObject(interview, Formatting.Indented)); + Interviewer.Reload(); } catch (Exception e) { @@ -306,7 +306,7 @@ public class AdminCommands Color = DiscordColor.Red, Description = "The uploaded JSON structure could not be converted to an interview template.\n\nError message:\n```\n" + e.Message + "\n```" - }); + }, true); return; } @@ -315,6 +315,6 @@ public class AdminCommands Color = DiscordColor.Green, Description = "Uploaded interview template." - }); + }, true); } } \ No newline at end of file