ytdl options
This commit is contained in:
parent
f704f2a82f
commit
7f73e02a60
3 changed files with 7 additions and 4 deletions
|
@ -18,7 +18,8 @@ const soundcloud = new SoundCloud();
|
|||
class DiscordPlayer extends EventEmitter<PlayerEvents> {
|
||||
public readonly client: Client;
|
||||
public readonly options: DiscordPlayerInitOptions = {
|
||||
autoRegisterExtractor: true
|
||||
autoRegisterExtractor: true,
|
||||
ytdlOptions: {}
|
||||
};
|
||||
public readonly queues = new Collection<Snowflake, Queue>();
|
||||
public readonly voiceUtils = new VoiceUtils();
|
||||
|
@ -96,6 +97,7 @@ class DiscordPlayer extends EventEmitter<PlayerEvents> {
|
|||
|
||||
const _meta = queueInitOptions.metadata;
|
||||
delete queueInitOptions["metadata"];
|
||||
queueInitOptions.ytdlOptions ??= this.options.ytdlOptions
|
||||
const queue = new Queue(this, guild, queueInitOptions);
|
||||
queue.metadata = _meta;
|
||||
this.queues.set(guild.id, queue);
|
||||
|
|
|
@ -35,7 +35,7 @@ class Queue<T = unknown> {
|
|||
leaveOnEmptyCooldown: 1000,
|
||||
autoSelfDeaf: true,
|
||||
enableLive: false,
|
||||
ytdlDownloadOptions: {},
|
||||
ytdlOptions: {},
|
||||
useSafeSearch: false,
|
||||
disableAutoRegister: false,
|
||||
fetchBeforeQueued: false,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Snowflake, User } from "discord.js";
|
||||
import { downloadOptions } from "ytdl-core";
|
||||
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";
|
||||
import { downloadOptions } from "ytdl-core";
|
||||
|
||||
export type FiltersName = keyof QueueFilters;
|
||||
|
||||
|
@ -80,7 +80,7 @@ export interface PlayerOptions {
|
|||
leaveOnEmptyCooldown?: number;
|
||||
autoSelfDeaf?: boolean;
|
||||
enableLive?: boolean;
|
||||
ytdlDownloadOptions?: downloadOptions;
|
||||
ytdlOptions?: downloadOptions;
|
||||
useSafeSearch?: boolean;
|
||||
disableAutoRegister?: boolean;
|
||||
fetchBeforeQueued?: boolean;
|
||||
|
@ -245,4 +245,5 @@ export interface PlaylistJSON {
|
|||
|
||||
export interface DiscordPlayerInitOptions {
|
||||
autoRegisterExtractor?: boolean;
|
||||
ytdlOptions?: downloadOptions;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue