Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
fix: couple of critical bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Oct 18, 2020
1 parent 18191e8 commit 717b1f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/base/BaseCluster.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { GatewaySendPayload } from 'discord-api-types/v6';
import { EventEmitter } from 'events';
import { ClusterNode, ClusterNodeOptions } from '../ClusterNode';
import type { Player } from '../core/Player';
import type { VoiceServerUpdate, VoiceStateUpdate } from './BaseNode';
import type { GatewaySendPayload } from 'discord-api-types/v6';

export interface ClusterFilter {
(node: ClusterNode, guildID: string): boolean;
Expand All @@ -24,7 +24,7 @@ export abstract class BaseCluster extends EventEmitter {
}

public connect() {
for (const node of this.nodes) node.connect();
return Promise.all(this.nodes.map((node) => node.connect()));
}

public spawn(options: ClusterNodeOptions): ClusterNode;
Expand Down
4 changes: 1 addition & 3 deletions src/core/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export class Connection<T extends BaseNode = BaseNode> {
public connect(): Promise<void> {
// Create a new ready listener if none was set.
if (!this.backoff.listenerCount('ready')) {
return new Promise((resolve, reject) => {
this.backoff.on('ready', () => this._connect().then(resolve, reject));
});
this.backoff.on('ready', () => this._connect());
}

return this._connect();
Expand Down

0 comments on commit 717b1f5

Please sign in to comment.