forked from snxraven/DiscordJS-v14-Template
modal patch to interactionCreate
This commit is contained in:
parent
a31234b717
commit
26621c9866
@ -48,6 +48,10 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
let dataToProcess = JSON.stringify(commandData[0])
|
let dataToProcess = JSON.stringify(commandData[0])
|
||||||
let parsedData = JSON.parse(dataToProcess)
|
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
|
// If the command is private, set ephemeral true else, set false
|
||||||
console.log(parsedData)
|
console.log(parsedData)
|
||||||
if (parsedData.private == true) {
|
if (parsedData.private == true) {
|
||||||
@ -60,8 +64,7 @@ client.on("interactionCreate", async (interaction) => {
|
|||||||
ephemeral: false
|
ephemeral: false
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const cmd = client.slashCommands.get(interaction.commandName);
|
const cmd = client.slashCommands.get(interaction.commandName);
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
|
Loading…
Reference in New Issue
Block a user