diff --git a/src/base/Node.ts b/src/base/Node.ts index ce5fd73..6ab1b85 100644 --- a/src/base/Node.ts +++ b/src/base/Node.ts @@ -41,7 +41,7 @@ export default abstract class BaseNode extends EventEmitter { public shardCount?: number; public connection?: Connection; - public players: PlayerStore = new PlayerStore(this); + public players: PlayerStore = new PlayerStore(this); public http?: Http; public voiceStates: Map = new Map(); diff --git a/src/core/Connection.ts b/src/core/Connection.ts index d4c8c6d..ec745b8 100644 --- a/src/core/Connection.ts +++ b/src/core/Connection.ts @@ -21,8 +21,8 @@ export interface Options extends WebSocket.ClientOptions { resumeTimeout?: number; } -export default class Connection { - public readonly node: Node; +export default class Connection { + public readonly node: T; public url: string; public options: Options; public resumeKey?: string; @@ -68,8 +68,8 @@ export default class Connection { private _queue: Array = []; - constructor(client: Node, url: string, options: Options = {}) { - this.node = client; + constructor(node: T, url: string, options: Options = {}) { + this.node = node; this.url = url; this.options = options; this.resumeKey = options.resumeKey; diff --git a/src/core/Player.ts b/src/core/Player.ts index 96c49ea..cb6eb61 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -35,12 +35,12 @@ export interface JoinOptions { deaf?: boolean; } -export default class Player extends EventEmitter { - public readonly node: Node; +export default class Player extends EventEmitter { + public readonly node: T; public guildID: string; public status: Status = Status.INSTANTIATED; - constructor(node: Node, guildID: string) { + constructor(node: T, guildID: string) { super(); this.node = node; this.guildID = guildID; diff --git a/src/core/PlayerStore.ts b/src/core/PlayerStore.ts index 16e5fde..b44f7fe 100644 --- a/src/core/PlayerStore.ts +++ b/src/core/PlayerStore.ts @@ -1,15 +1,15 @@ import Player from './Player'; import Node from '../base/Node'; -export default class PlayerStore extends Map { - public readonly node: Node; +export default class PlayerStore extends Map> { + public readonly node: T; - constructor(node: Node) { + constructor(node: T) { super(); this.node = node; } - public get(key: string): Player { + public get(key: string): Player { let player = super.get(key); if (!player) { player = new Player(this.node, key);