From 84a0d7bbe1182441ee605820af4b83f4946e840e Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 6 Jun 2023 23:27:41 +0200 Subject: [PATCH] turn all slash command replies into an ephemeral message Setting ephemeral has to happen in an initial reply (reply() or deferReply()) to set the mode for all replies in this 'thread'. Once the ephemeral state of a message has been set it can not be changed. If you want to send a visible message after an ephemeral message it has to be new message. See https://discordjs.guide/slash-commands/response-methods.html#ephemeral-responses --- server/events/interactionCreate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/events/interactionCreate.ts b/server/events/interactionCreate.ts index d15d07a..c483f8f 100644 --- a/server/events/interactionCreate.ts +++ b/server/events/interactionCreate.ts @@ -8,7 +8,7 @@ export async function execute(interaction: ExtendedInteraction) { //console.dir(interaction, { depth: null }) if (interaction.isCommand()) { logger.info(`Interaction is a command.`, { guildId: interaction.guild?.id }) - await interaction.deferReply() + await interaction.deferReply({ ephemeral: true }) const command = client.commands.get(interaction.commandName) if (!command) return interaction.followUp('Invalid command')