From 590ef129532f2f24c916b2c67a1f9cbdadf08f5f Mon Sep 17 00:00:00 2001 From: almeidx Date: Sun, 4 Aug 2024 02:35:11 +0100 Subject: [PATCH] fix: ws `presence` validation --- packages/discord.js/src/client/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/client/Client.js b/packages/discord.js/src/client/Client.js index a32877cd77ec4..2bc0c70cd61f2 100644 --- a/packages/discord.js/src/client/Client.js +++ b/packages/discord.js/src/client/Client.js @@ -557,7 +557,7 @@ class Client extends BaseClient { if (typeof options.ws !== 'object' || options.ws === null) { throw new DiscordjsTypeError(ErrorCodes.ClientInvalidOption, 'ws', 'an object'); } - if (typeof options.ws.presence !== 'object' || options.ws.presence === null) { + if ('presence' in options.ws && (typeof options.ws.presence !== 'object' || options.ws.presence === null)) { throw new DiscordjsTypeError(ErrorCodes.ClientInvalidOption, 'ws.presence', 'an object'); } if (typeof options.rest !== 'object' || options.rest === null) {