From f4b1b398d9c15d43e012eb3b8971ae0fc8412dc0 Mon Sep 17 00:00:00 2001 From: Saya <36309350+Deivu@users.noreply.github.com> Date: Mon, 2 Mar 2020 01:21:48 +0800 Subject: [PATCH] feat: document intent error code messages (#3871) * Add 4013, Invalid Intents close code * Add 4014, Disallowed Intents Code * Add error messages for 4013 & 4014 * Rephrase invalid & disallowed intent error message * Rephrase disallowed intent error message --- src/errors/Messages.js | 2 ++ src/util/Constants.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/errors/Messages.js b/src/errors/Messages.js index c3e379605..5b4299d49 100644 --- a/src/errors/Messages.js +++ b/src/errors/Messages.js @@ -17,6 +17,8 @@ const Messages = { SHARDING_INVALID: 'Invalid shard settings were provided.', SHARDING_REQUIRED: 'This session would have handled too many guilds - Sharding is required.', + INVALID_INTENTS: 'Invalid intent provided for WebSocket intents.', + DISALLOWED_INTENTS: 'Privileged intent provided is not enabled or whitelisted.', SHARDING_NO_SHARDS: 'No shards have been spawned.', SHARDING_IN_PROCESS: 'Shards are still being spawned.', SHARDING_ALREADY_SPAWNED: count => `Already spawned ${count} shards.`, diff --git a/src/util/Constants.js b/src/util/Constants.js index 74365789d..7bc28a4e2 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -95,6 +95,8 @@ exports.WSCodes = { 4004: 'TOKEN_INVALID', 4010: 'SHARDING_INVALID', 4011: 'SHARDING_REQUIRED', + 4013: 'INVALID_INTENTS', + 4014: 'DISALLOWED_INTENTS', }; const AllowedImageFormats = ['webp', 'png', 'jpg', 'gif'];