diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts deleted file mode 100644 index f2382ce..0000000 --- a/src/events/interactionCreate.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Interaction } from "discord.js" -import { v4 as uuidv4 } from "uuid" -import { log } from "../services/logger" -module.exports = { - name: "interactionCreate", - once: false, - async execute(interaction: Interaction) { - if (!interaction.isChatInputCommand()) return - - const command = interaction.client.commands.get(interaction.commandName) - - if (!command) return - - try { - await command.execute(interaction).catch((error: unknown) => { - const errorId = uuidv4() - log.error(error, errorId) - interaction.deferred - ? interaction.editReply({ - content: `There was an error while executing this command. Error ID: ${errorId}`, - embeds: [], - files: [] - }) - : interaction.reply({ - content: `There was an error while executing this command. Error ID: ${errorId}`, - embeds: [], - files: [] - }) - }) - } catch (error) { - const errorId = uuidv4() - log.error(error, errorId) - interaction.deferred - ? interaction.editReply({ - content: `There was an error while executing this command. Error ID: ${errorId}`, - embeds: [], - files: [] - }) - : interaction.reply({ - content: `There was an error while executing this command. Error ID: ${errorId}`, - embeds: [], - files: [] - }) - } - } -}