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