Use intent from connect function if it was set in both function and client setting
This commit is contained in:
parent
9c67ff6c84
commit
8a0882cd4d
1 changed files with 7 additions and 2 deletions
|
@ -140,9 +140,14 @@ export class Client extends EventEmitter {
|
||||||
else if (this.token === undefined && token !== undefined) {
|
else if (this.token === undefined && token !== undefined) {
|
||||||
this.token = token
|
this.token = token
|
||||||
} else throw new Error('No Token Provided')
|
} else throw new Error('No Token Provided')
|
||||||
if (intents === undefined && this.intents !== undefined)
|
if (intents !== undefined && this.intents !== undefined) {
|
||||||
|
this.debug(
|
||||||
|
'client',
|
||||||
|
'Intents were set in both client and connect function. Using the one in the connect function...'
|
||||||
|
)
|
||||||
|
} else if (intents === undefined && this.intents !== undefined) {
|
||||||
intents = this.intents
|
intents = this.intents
|
||||||
else if (intents !== undefined && this.intents === undefined) {
|
} else if (intents !== undefined && this.intents === undefined) {
|
||||||
this.intents = intents
|
this.intents = intents
|
||||||
} else throw new Error('No Gateway Intents were provided')
|
} else throw new Error('No Gateway Intents were provided')
|
||||||
this.gateway = new Gateway(this, token, intents)
|
this.gateway = new Gateway(this, token, intents)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue