diff --git a/src/ClusterNode.ts b/src/ClusterNode.ts index e2f5f7b9..0a4100ed 100644 --- a/src/ClusterNode.ts +++ b/src/ClusterNode.ts @@ -31,9 +31,9 @@ export class ClusterNode extends BaseNode { public emit(event: ConnectionEvents.PlayerUpdate, payload: IncomingPlayerUpdatePayload): boolean; public emit(event: ConnectionEvents.Stats, payload: IncomingStatsPayload): boolean; public emit(event: ConnectionEvents.Upgrade, req: IncomingMessage): boolean; - public emit(event: ConnectionEvents, ...args: any[]): boolean { + public emit(event: ConnectionEvents, ...args: readonly any[]): boolean { // @ts-expect-error Expect same arguments as parent. - if (this.listenerCount(name)) super.emit(name, ...args); + if (this.listenerCount(event)) super.emit(event, ...args); return this.cluster.emit(event, ...args); } diff --git a/src/base/BaseCluster.ts b/src/base/BaseCluster.ts index ac04f40b..d354f084 100644 --- a/src/base/BaseCluster.ts +++ b/src/base/BaseCluster.ts @@ -9,7 +9,7 @@ export interface ClusterFilter { } export interface ClusterSend { - (guildID: string, packet: GatewaySendPayload): any; + (guildID: string, packet: GatewaySendPayload): unknown; } export abstract class BaseCluster extends EventEmitter { diff --git a/src/base/BaseNode.ts b/src/base/BaseNode.ts index a2108326..c3cd0c4b 100644 --- a/src/base/BaseNode.ts +++ b/src/base/BaseNode.ts @@ -90,7 +90,7 @@ export interface NodeOptions { } export interface NodeSend { - (guildID: string, packet: GatewaySendPayload): Promise; + (guildID: string, packet: GatewaySendPayload): unknown; } export abstract class BaseNode extends EventEmitter { diff --git a/src/core/Connection.ts b/src/core/Connection.ts index be41b74f..147d3aa6 100644 --- a/src/core/Connection.ts +++ b/src/core/Connection.ts @@ -317,7 +317,7 @@ export class Connection { this.node.emit(pk.op, pk); } - private onError(err: any): void { + private onError(err: Error): void { this.node.emit(ConnectionEvents.Error, err); this._reconnect(); } diff --git a/src/core/Http.ts b/src/core/Http.ts index 656b93ad..52fd424b 100644 --- a/src/core/Http.ts +++ b/src/core/Http.ts @@ -322,7 +322,7 @@ export class Http { return this.do('GET', url); } - public async do(method: string, url: URL, data?: Buffer): Promise { + public async do(method: string, url: URL, data?: Buffer): Promise { const message = await new Promise((resolve) => { const req = request( { diff --git a/src/core/Player.ts b/src/core/Player.ts index 815f63ef..8ad07cc8 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -110,11 +110,11 @@ export class Player extends EventEmitter { await Promise.all([node.voiceStateUpdate(voiceState), node.voiceServerUpdate(voiceServer)]); } - public leave(): Promise { + public leave(): unknown { return this.join(null); } - public join(channel: string | null, { deaf = false, mute = false }: JoinOptions = {}): Promise { + public join(channel: string | null, { deaf = false, mute = false }: JoinOptions = {}): unknown { this.node.voiceServers.delete(this.guildID); this.node.voiceStates.delete(this.guildID);