From 806163e104aad73b28b7b25e11df74e445be6f85 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Wed, 4 Jan 2023 14:01:50 -0500 Subject: [PATCH] readding privacy code --- events/interactionCreate.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/events/interactionCreate.js b/events/interactionCreate.js index aae4724..f54a184 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -12,9 +12,22 @@ client.on("interactionCreate", async (interaction) => { if (interaction.commandName === 'advanced'){ console.log("Modal detected, skipping...") } else { - // If not, defer and wait for edits - Max 15 Minutes! - // Send defer depending on what the user has their privacy set to - await interaction.deferReply({ ephemeral: false }).catch(() => { }); + // Process and Parse Data + let dataToProcess = JSON.stringify(commandData[0]) + let parsedData = JSON.parse(dataToProcess) + + // If the command is private, set ephemeral true else, set false + if (parsedData.private == true) { + await interaction.deferReply({ + ephemeral: true + }).catch(() => {}); + + } else { + await interaction.deferReply({ + ephemeral: false + }).catch(() => {}); + } + } // Get command info