readding privacy code
This commit is contained in:
parent
55171efd7f
commit
806163e104
@ -12,9 +12,22 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
if (interaction.commandName === 'advanced'){
|
if (interaction.commandName === 'advanced'){
|
||||||
console.log("Modal detected, skipping...")
|
console.log("Modal detected, skipping...")
|
||||||
} else {
|
} else {
|
||||||
// If not, defer and wait for edits - Max 15 Minutes!
|
// Process and Parse Data
|
||||||
// Send defer depending on what the user has their privacy set to
|
let dataToProcess = JSON.stringify(commandData[0])
|
||||||
await interaction.deferReply({ ephemeral: false }).catch(() => { });
|
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
|
// Get command info
|
||||||
|
Loading…
Reference in New Issue
Block a user