diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index 9e9abf9..b6873b2 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -1,3 +1,5 @@ +// TODO: Moving that to a dedicated function that works for both messages and interactions + import { PermissionFlagsBits, InteractionType } from 'discord.js'; import db from '../../models/index.js'; import ratelimiter from '../../utils/ratelimiter.js'; @@ -114,7 +116,7 @@ export default { } catch (error) { console.error(error); - await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.followUp({ content: `There was an error while executing this command!\n\`${error}\``, ephemeral: true }); } }, }; diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index 5d041e6..1649c3f 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -253,6 +253,7 @@ export default { } // Command handling from message + // TODO: Moving that to a dedicated function that works for both messages and interactions let hasPrefix = false; prefixs.forEach(p => { @@ -440,7 +441,11 @@ export default { } catch (error) { console.error(error); - await message.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + await message.reply({ content: `There was an error while executing this command!\n\`${error}\`` }) + .catch(async () => { + await message.channel.send({ content: `There was an error while executing this command!\n\`${error}\`` }); + }); + } }, };