Skip to content

Commit

Permalink
fix: ws presence validation
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Aug 4, 2024
1 parent f623e7a commit 590ef12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/discord.js/src/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 590ef12

Please sign in to comment.