aboutsummaryrefslogtreecommitdiff
path: root/bot/src/events/InteractionCreate.js
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/events/InteractionCreate.js')
-rw-r--r--bot/src/events/InteractionCreate.js10
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 });
}
}
}