From 2a5b766c2b728c75c70e527403f3ebe38b565420 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 4 Nov 2020 23:17:13 +0200 Subject: [PATCH] Add better error message for 'Disallowed intents specified' --- src/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.js b/src/index.js index df5893c..f656345 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,17 @@ function errorHandler(err) { } else if (err instanceof utils.BotError) { // Leave out stack traces for BotErrors (the message has enough info) console.error(`Error: ${err.message}`); + } else if (err.message === "Disallowed intents specified") { + let fullMessage = "Error: Disallowed intents specified"; + fullMessage += "\n\n"; + fullMessage += "To run the bot, you must enable 'Server Members Intent' on your bot's page in the Discord Developer Portal:"; + fullMessage += "\n\n"; + fullMessage += "1. Go to https://discord.com/developers/applications" + fullMessage += "2. Click on your bot" + fullMessage += "3. Click 'Bot' on the sidebar" + fullMessage += "4. Turn on 'Server Members Intent'" + + console.error(fullMessage); } else { // Truncate long stack traces for other errors const stack = err.stack || "";