From 58c3589295f95b3ea4c04a3b6ffae6dadeb207b7 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Mon, 14 Jun 2021 01:19:59 +0545 Subject: [PATCH] connection event --- src/Structures/Queue.ts | 2 ++ src/types/types.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index e828a64..36de580 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -66,6 +66,8 @@ class Queue { this.connection.on("error", (err) => this.player.emit("error", this, err)); this.connection.on("debug", (msg) => this.player.emit("debug", this, msg)); + this.player.emit("connectionCreate", this, this.connection); + return this; } diff --git a/src/types/types.ts b/src/types/types.ts index 36a9344..3a5d01a 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -4,6 +4,7 @@ import { Readable, Duplex } from "stream"; import { Queue } from "../Structures/Queue"; import Track from "../Structures/Track"; import { Playlist } from "../Structures/Playlist"; +import { StreamDispatcher } from "../VoiceInterface/BasicStreamDispatcher"; export type FiltersName = keyof QueueFilters; @@ -130,7 +131,7 @@ export interface PlayerEvents { /** * Emitted when bot connects to a voice channel */ - connectionCreate: (queue: Queue) => any; + connectionCreate: (queue: Queue, connection: StreamDispatcher) => any; /** * Debug information */