fix(BaseClient): Default in objects properly (#9952)

fix(BaseClient): default in objects properly
This commit is contained in:
Jiralite 2023-11-12 22:14:09 +01:00 committed by GitHub
parent f0ec70dfda
commit f93abf7e35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,11 +27,20 @@ class BaseClient extends EventEmitter {
this.options = {
...defaultOptions,
...options,
presence: {
...defaultOptions.presence,
...options.presence,
},
sweepers: {
...defaultOptions.sweepers,
...options.sweepers,
},
ws: {
...defaultOptions.ws,
...options.ws,
},
rest: {
...defaultOptions.rest,
...options.rest,
userAgentAppendix: options.rest?.userAgentAppendix
? `${Options.userAgentAppendix} ${options.rest.userAgentAppendix}`