const { InteractionType } = require("discord.js");module.exports = { name: "interactionCreate", on: true, async execute(interaction) { if (interaction.type === InteractionType.ApplicationCommand) { const command = interaction.client.commands.get(interaction.commandName); if (!command) return; console.log("past"); try { await command.execute(interaction); } catch (error) { console.error(error); await interaction.reply({ content: "There was an error while executing this command!", ephemeral: true, }); } } else if (interaction.type === InteractionType.ModalSubmit) { if (interaction.customId === "modal") { await interaction.reply({ content: "Subbmited", ephemeral: true }); } } },};
const { InteractionType } = require("discord.js");module.exports = { name: "interactionCreate", on: true, async execute(interaction) { if (interaction.type === InteractionType.ApplicationCommand) { const command = interaction.client.commands.get(interaction.commandName); if (!command) return; console.log("past"); try { await command.execute(interaction); } catch (error) { console.error(error); await interaction.reply({ content: "There was an error while executing this command!", ephemeral: true, }); } } else if (interaction.type === InteractionType.ModalSubmit) { if (interaction.customId === "modal") { await interaction.reply({ content: "Subbmited", ephemeral: true }); } } },};