connection event

This commit is contained in:
Snowflake107 2021-06-14 01:19:59 +05:45
parent 0cdcda381b
commit 58c3589295
2 changed files with 4 additions and 1 deletions

View file

@ -66,6 +66,8 @@ class Queue<T = unknown> {
this.connection.on("error", (err) => this.player.emit("error", this, err)); this.connection.on("error", (err) => this.player.emit("error", this, err));
this.connection.on("debug", (msg) => this.player.emit("debug", this, msg)); this.connection.on("debug", (msg) => this.player.emit("debug", this, msg));
this.player.emit("connectionCreate", this, this.connection);
return this; return this;
} }

View file

@ -4,6 +4,7 @@ import { Readable, Duplex } from "stream";
import { Queue } from "../Structures/Queue"; import { Queue } from "../Structures/Queue";
import Track from "../Structures/Track"; import Track from "../Structures/Track";
import { Playlist } from "../Structures/Playlist"; import { Playlist } from "../Structures/Playlist";
import { StreamDispatcher } from "../VoiceInterface/BasicStreamDispatcher";
export type FiltersName = keyof QueueFilters; export type FiltersName = keyof QueueFilters;
@ -130,7 +131,7 @@ export interface PlayerEvents {
/** /**
* Emitted when bot connects to a voice channel * Emitted when bot connects to a voice channel
*/ */
connectionCreate: (queue: Queue) => any; connectionCreate: (queue: Queue, connection: StreamDispatcher) => any;
/** /**
* Debug information * Debug information
*/ */