Made interview command responses ephemeral
This commit is contained in:
parent
f9fbc5990c
commit
839ec527df
1 changed files with 6 additions and 6 deletions
|
@ -229,7 +229,7 @@ public class AdminCommands
|
||||||
public async Task GetInterviewTemplates(SlashCommandContext command)
|
public async Task GetInterviewTemplates(SlashCommandContext command)
|
||||||
{
|
{
|
||||||
MemoryStream stream = new(Encoding.UTF8.GetBytes(Database.GetInterviewTemplatesJSON()));
|
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")]
|
[Command("setinterviewtemplates")]
|
||||||
|
@ -240,10 +240,9 @@ public class AdminCommands
|
||||||
{
|
{
|
||||||
await command.RespondAsync(new DiscordEmbedBuilder
|
await command.RespondAsync(new DiscordEmbedBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
Color = DiscordColor.Red,
|
Color = DiscordColor.Red,
|
||||||
Description = "The uploaded file is not a JSON file according to Discord."
|
Description = "The uploaded file is not a JSON file according to Discord."
|
||||||
});
|
}, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,11 +292,12 @@ public class AdminCommands
|
||||||
{
|
{
|
||||||
Text = "More detailed information may be available as debug messages in the bot logs."
|
Text = "More detailed information may be available as debug messages in the bot logs."
|
||||||
}
|
}
|
||||||
});
|
}, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Database.SetInterviewTemplates(JsonConvert.SerializeObject(interview, Formatting.Indented));
|
Database.SetInterviewTemplates(JsonConvert.SerializeObject(interview, Formatting.Indented));
|
||||||
|
Interviewer.Reload();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -306,7 +306,7 @@ public class AdminCommands
|
||||||
|
|
||||||
Color = DiscordColor.Red,
|
Color = DiscordColor.Red,
|
||||||
Description = "The uploaded JSON structure could not be converted to an interview template.\n\nError message:\n```\n" + e.Message + "\n```"
|
Description = "The uploaded JSON structure could not be converted to an interview template.\n\nError message:\n```\n" + e.Message + "\n```"
|
||||||
});
|
}, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,6 +315,6 @@ public class AdminCommands
|
||||||
|
|
||||||
Color = DiscordColor.Green,
|
Color = DiscordColor.Green,
|
||||||
Description = "Uploaded interview template."
|
Description = "Uploaded interview template."
|
||||||
});
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue