Merge remote-tracking branch 'origin/main' into slash

This commit is contained in:
DjDeveloperr 2021-02-10 18:00:10 +05:30
commit f4b4c640b3
2 changed files with 5 additions and 5 deletions

View File

@ -291,10 +291,9 @@ export class Client extends HarmonyEventEmitter<ClientEvents> {
* @param intents Gateway intents in array. This is required if not given in ClientOptions.
*/
async connect(token?: string, intents?: GatewayIntents[]): Promise<Client> {
if (token === undefined && this.token !== undefined) token = this.token
else if (this.token === undefined && token !== undefined) {
this.token = token
} else throw new Error('No Token Provided')
token ??= this.token
if (token === undefined) throw new Error('No Token Provided')
this.token = token
if (intents !== undefined && this.intents !== undefined) {
this.debug(
'client',

View File

@ -27,7 +27,8 @@ export class BitField {
has(bit: BitFieldResolvable, ...args: any[]): boolean {
if (Array.isArray(bit)) return (bit.every as any)((p: any) => this.has(p))
return (this.bitfield & BitField.resolve(this.flags, bit)) === bit
bit = BitField.resolve(this.flags, bit)
return (this.bitfield & bit) === bit
}
missing(bits: any, ...hasParams: any[]): string[] {