diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-07 17:22:21 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-07 17:22:21 -0500 |
| commit | c921e5cf8862def58029bd1801074c51113f86ae (patch) | |
| tree | 99c8c513fd56863984ee458e747f69a87ad3c715 /bot/src/events/InteractionCreate.js | |
| parent | cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a (diff) | |
| download | AleeBot-c921e5cf8862def58029bd1801074c51113f86ae.tar.gz AleeBot-c921e5cf8862def58029bd1801074c51113f86ae.tar.bz2 AleeBot-c921e5cf8862def58029bd1801074c51113f86ae.zip | |
More settings; Better error message; Database
Diffstat (limited to 'bot/src/events/InteractionCreate.js')
| -rw-r--r-- | bot/src/events/InteractionCreate.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bot/src/events/InteractionCreate.js b/bot/src/events/InteractionCreate.js index eadef09..8f1e998 100644 --- a/bot/src/events/InteractionCreate.js +++ b/bot/src/events/InteractionCreate.js @@ -1,5 +1,9 @@ import { Events, MessageFlags } from 'discord.js'; +function error(e) { + return `Something went wrong. [Submit an issue at the AleeBot repository.](<https://github.com/Alee14/AleeBot/issues>)\nMessage:\n\`\`\`${e.stack}\`\`\``; +} + export default { name: Events.InteractionCreate, async execute(interaction) { @@ -12,11 +16,11 @@ export default { try { await command.execute(interaction); } catch (e) { - console.log(e); + console.error(e); if (interaction.replied || interaction.deferred) { - await interaction.followUp({ content: `Something went wrong. The following error message:\n\`\`\`${e}\`\`\``, flags: MessageFlags.Ephemeral }); + await interaction.followUp({ content: error(e), flags: MessageFlags.Ephemeral }); } else { - await interaction.reply({ content: `Something went wrong. The following error message:\n\`\`\`${e}\`\`\``, flags: MessageFlags.Ephemeral }); + await interaction.reply({ content: error(e), flags: MessageFlags.Ephemeral }); } } } |
