modal patch to interactionCreate

This commit is contained in:
Raven Scott 2023-04-22 23:11:37 +02:00
parent a31234b717
commit 26621c9866
1 changed files with 5 additions and 2 deletions

View File

@ -48,6 +48,10 @@ client.on("interactionCreate", async (interaction) => {
let dataToProcess = JSON.stringify(commandData[0])
let parsedData = JSON.parse(dataToProcess)
if (interaction.commandName == "modal-example"){
console.log("Modal - Skipping defer")
} else {
// If the command is private, set ephemeral true else, set false
console.log(parsedData)
if (parsedData.private == true) {
@ -60,8 +64,7 @@ client.on("interactionCreate", async (interaction) => {
ephemeral: false
}).catch(() => {});
}
}
const cmd = client.slashCommands.get(interaction.commandName);
if (!cmd)
return interaction.followUp({