rename BasicStreamDispatcher

This commit is contained in:
Snowflake107 2021-06-25 13:09:53 +05:45
parent 62c16d86dd
commit 1d55792f1f
5 changed files with 11 additions and 8 deletions

View file

@ -1,6 +1,6 @@
import { Collection, Guild, StageChannel, VoiceChannel } from "discord.js"; import { Collection, Guild, StageChannel, VoiceChannel } from "discord.js";
import { Player } from "../Player"; import { Player } from "../Player";
import { StreamDispatcher } from "../VoiceInterface/BasicStreamDispatcher"; import { StreamDispatcher } from "../VoiceInterface/StreamDispatcher";
import Track from "./Track"; import Track from "./Track";
import { PlayerOptions, PlayerProgressbarOptions, PlayOptions, QueueFilters, QueueRepeatMode } from "../types/types"; import { PlayerOptions, PlayerProgressbarOptions, PlayOptions, QueueFilters, QueueRepeatMode } from "../types/types";
import ytdl from "discord-ytdl-core"; import ytdl from "discord-ytdl-core";
@ -616,6 +616,7 @@ class Queue<T = unknown> {
* Private method to handle autoplay * Private method to handle autoplay
* @param {Track} track The source track to find its similar track for autoplay * @param {Track} track The source track to find its similar track for autoplay
* @returns {Promise<void>} * @returns {Promise<void>}
* @private
*/ */
private async _handleAutoplay(track: Track): Promise<void> { private async _handleAutoplay(track: Track): Promise<void> {
this.#watchDestroyed(); this.#watchDestroyed();

View file

@ -18,10 +18,12 @@ import Track from "../Structures/Track";
import { Util } from "../utils/Util"; import { Util } from "../utils/Util";
export interface VoiceEvents { export interface VoiceEvents {
error: (error: AudioPlayerError) => any; // eslint-disable-line @typescript-eslint/no-explicit-any /* eslint-disable @typescript-eslint/no-explicit-any */
debug: (message: string) => any; // eslint-disable-line @typescript-eslint/no-explicit-any error: (error: AudioPlayerError) => any;
start: (resource: AudioResource<Track>) => any; // eslint-disable-line @typescript-eslint/no-explicit-any debug: (message: string) => any;
finish: (resource: AudioResource<Track>) => any; // eslint-disable-line @typescript-eslint/no-explicit-any start: (resource: AudioResource<Track>) => any;
finish: (resource: AudioResource<Track>) => any;
/* eslint-enable @typescript-eslint/no-explicit-any */
} }
class StreamDispatcher extends EventEmitter<VoiceEvents> { class StreamDispatcher extends EventEmitter<VoiceEvents> {

View file

@ -1,6 +1,6 @@
import { VoiceChannel, StageChannel, Collection, Snowflake } from "discord.js"; import { VoiceChannel, StageChannel, Collection, Snowflake } from "discord.js";
import { DiscordGatewayAdapterCreator, entersState, joinVoiceChannel, VoiceConnection, VoiceConnectionStatus } from "@discordjs/voice"; import { DiscordGatewayAdapterCreator, entersState, joinVoiceChannel, VoiceConnection, VoiceConnectionStatus } from "@discordjs/voice";
import { StreamDispatcher } from "./BasicStreamDispatcher"; import { StreamDispatcher } from "./StreamDispatcher";
import { VoiceAdapterCreator } from "./AdapterCreator"; import { VoiceAdapterCreator } from "./AdapterCreator";
class VoiceUtils { class VoiceUtils {

View file

@ -8,6 +8,6 @@ export { StreamUtils } from "./utils/StreamUtils";
export { Track } from "./Structures/Track"; export { Track } from "./Structures/Track";
export { Util } from "./utils/Util"; export { Util } from "./utils/Util";
export { VoiceUtils } from "./VoiceInterface/VoiceUtils"; export { VoiceUtils } from "./VoiceInterface/VoiceUtils";
export { VoiceEvents, StreamDispatcher } from "./VoiceInterface/BasicStreamDispatcher"; export { VoiceEvents, StreamDispatcher } from "./VoiceInterface/StreamDispatcher";
export { VoiceAdapterCreator } from "./VoiceInterface/AdapterCreator"; export { VoiceAdapterCreator } from "./VoiceInterface/AdapterCreator";
export * from "./types/types"; export * from "./types/types";

View file

@ -3,7 +3,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"; import { StreamDispatcher } from "../VoiceInterface/StreamDispatcher";
import { downloadOptions } from "ytdl-core"; import { downloadOptions } from "ytdl-core";
export type FiltersName = keyof QueueFilters; export type FiltersName = keyof QueueFilters;