diff --git a/lib/newstruct/aoiVoice.d.ts b/lib/newstruct/aoiVoice.d.ts index 0484798..d42b4d0 100755 --- a/lib/newstruct/aoiVoice.d.ts +++ b/lib/newstruct/aoiVoice.d.ts @@ -22,7 +22,7 @@ export declare class AoiVoice extends Manager { addEvent(event: PlayerEvents): void; addEvents(...events: PlayerEvents[]): void; bindExecutor(executor: Function): void; - joinVc({ type, voiceChannel, textChannel, selfDeaf, selfMute, }: { + joinVc({ type, voiceChannel, textChannel, selfDeaf, selfMute }: { type: AudioPLayerOptions["type"]; voiceChannel: VoiceChannel; textChannel: Snowflake; diff --git a/lib/newstruct/aoiVoice.js b/lib/newstruct/aoiVoice.js index 234e507..b783903 100755 --- a/lib/newstruct/aoiVoice.js +++ b/lib/newstruct/aoiVoice.js @@ -38,7 +38,7 @@ class AoiVoice extends manager_1.Manager { [enums_1.PlayerEvents.AudioError]: new discord_js_1.Collection(), [enums_1.PlayerEvents.QueueStart]: new discord_js_1.Collection(), [enums_1.PlayerEvents.TrackPause]: new discord_js_1.Collection(), - [enums_1.PlayerEvents.TrackResume]: new discord_js_1.Collection(), + [enums_1.PlayerEvents.TrackResume]: new discord_js_1.Collection() }; __classPrivateFieldSet(this, _AoiVoice_events, [], "f"); __classPrivateFieldSet(this, _AoiVoice_executor, () => { }, "f"); @@ -57,18 +57,18 @@ class AoiVoice extends manager_1.Manager { bindExecutor(executor) { __classPrivateFieldSet(this, _AoiVoice_executor, executor, "f"); } - async joinVc({ type = "default", voiceChannel, textChannel, selfDeaf = true, selfMute = false, }) { + async joinVc({ type = "default", voiceChannel, textChannel, selfDeaf = true, selfMute = false }) { await super .joinVc({ type, voiceChannel, selfDeaf, - selfMute, + selfMute }) .catch((e) => false); this.prunes.set(voiceChannel.guild.id, { message: null, - channel: textChannel, + channel: textChannel }); return true; } @@ -85,10 +85,10 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu // @ts-ignore guild: __classPrivateFieldGet(this, _AoiVoice_bot, "f").guilds.cache.get(player.options.connection.joinConfig.guildId), // @ts-ignore - channel: __classPrivateFieldGet(this, _AoiVoice_bot, "f").channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId).channel), + channel: __classPrivateFieldGet(this, _AoiVoice_bot, "f").channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId).channel) }, [], { code: cmd.channel, name: "NameParser" }, undefined, true, undefined, { data: data[0], - player: player, + player: player }))?.code; } //@ts-ignore @@ -97,10 +97,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu // @ts-ignore guild: __classPrivateFieldGet(this, _AoiVoice_bot, "f").guilds.cache.get(player.options.connection.joinConfig.guildId), // @ts-ignore - channel: __classPrivateFieldGet(this, _AoiVoice_bot, "f").channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId) - .channel), + channel: __classPrivateFieldGet(this, _AoiVoice_bot, "f").channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId).channel) }, [], cmd, undefined, false, channel, { - data: data[0], + data: data[0] }); } else { @@ -109,7 +108,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu client: __classPrivateFieldGet(this, _AoiVoice_bot, "f").client, channel: this.prunes.get(player.options.connection.joinConfig.guildId).channel, guild: __classPrivateFieldGet(this, _AoiVoice_bot, "f").guilds.cache.get(player.options.connection.joinConfig.guildId), - player: player, + player: player }); } }); @@ -133,7 +132,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu type: "djs", code: async (d) => { const data = d.util.aoiFunc(d); - let [voiceId = d.member?.voice?.channelId, selfDeaf = "true", selfMute = "false", speaker = "true", audioPlayerType = "default", debug = "false",] = data.inside.splits; + let [voiceId = d.member?.voice?.channelId, selfDeaf = "true", selfMute = "false", speaker = "true", audioPlayerType = "default", debug = "false"] = data.inside.splits; const vc = await d.util.getChannel(d, voiceId); if (!vc) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Invalid Channel ID Provided"); @@ -148,7 +147,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu textChannel: d.channel.id, selfMute: selfMute === "true", selfDeaf: selfDeaf === "true", - debug: debug === "true", + debug: debug === "true" }); if (speaker === "true" && vc.type === d.util.channelTypes.Stage) { await (d.guild.me ?? d.guild.members.me).voice.setSuppressed(false); @@ -158,9 +157,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu d.aoiError.fnError(d, "custom", {}, "Failed To Join VC With Reason: " + e); } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //leave { @@ -178,9 +177,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) d.client.voiceManager.leaveVc(guild.id); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //play { @@ -222,9 +221,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (tracks?.length !== 0) await player.add(tracks, trackType, d.member); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //queue { @@ -232,7 +231,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu type: "djs", code: async (d) => { const data = d.util.aoiFunc(d); - const [page = 1, limit = 10, format = `{position}) {title} | {requester.user.tag}`, sep = ",",] = data.inside.splits; + const [page = 1, limit = 10, format = `{position}) {title} | {requester.user.tag}`, sep = ","] = data.inside.splits; if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); const hasPlayer = d.client.voiceManager.players.has(d.guild.id); @@ -241,9 +240,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu const player = d.client.voiceManager.players.get(d.guild.id); data.result = player.getQueue(page, limit, format).join(sep); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // autoplay { @@ -268,9 +267,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu } player.autoPlay = type.toLowerCase(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //addFilter { @@ -298,16 +297,16 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu else { result.push({ filter: key, - value: parsed[key], + value: parsed[key] }); } } ffilter.add(result, player); data.result = returnfilters === "true" ? result : null; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //setFilter { @@ -335,16 +334,16 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu else { result.push({ filter: key, - value: parsed[key], + value: parsed[key] }); } } ffilter.set(result, player); data.result = returnfilters === "true" ? result : null; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //removeFilter { @@ -372,9 +371,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu } data.result = returnfilters === "true" ? player.filters : null; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //resetFilter { @@ -393,9 +392,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu const ffilter = this.plugins.get(enums_1.PluginName.Filter); ffilter.removeAll(player); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //getFilters { @@ -413,9 +412,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu } data.result = player.filters; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //volume { @@ -436,9 +435,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu player.volume = Number(volume); } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //seek { @@ -457,9 +456,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); ffilter.seek(Number(time), player); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //getCurrentTrackDuration { @@ -473,9 +472,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) data.result = player.getTrackCurrentDuration(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //hasplayer { @@ -487,9 +486,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); data.result = d.client.voiceManager.players.has(d.guild.id); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // loopMode { @@ -508,9 +507,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu player.loop = mode; } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //loopStatus { @@ -524,9 +523,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) data.result = player.loop; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //ClearQueue { @@ -540,9 +539,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.queue = []; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //pauseTrack { @@ -556,9 +555,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.pause(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //resumeTrack { @@ -572,9 +571,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.resume(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // removeTrack { @@ -593,9 +592,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.removeTrack(Number(position)); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // stopTrack { @@ -609,9 +608,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.stop(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //skipTrack { @@ -625,9 +624,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.skip(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // skipTo { @@ -646,9 +645,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu player.skipTo(index); } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // playPreviousTrack { @@ -662,9 +661,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.playPrevious(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // queueLength { @@ -678,9 +677,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) data.result = player.queue.length ?? 0; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // voicePing { @@ -698,9 +697,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) data.result = player.getPing(type); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // playerStatus { @@ -714,9 +713,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) data.result = player.player._state.status; return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // stop { @@ -730,9 +729,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player._destroy(); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // shuffleQueue { @@ -746,9 +745,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (player) player.queue = (0, helpers_1.shuffle)(player.queue); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, //unshuffleQueue { @@ -763,9 +762,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu player.queue = player.queue.sort((a, b) => a.position - b.position); } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // songInfo { @@ -787,9 +786,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu if (type === "artistURL") { util.deprecate(() => { }, "artistURL is deprecated. Please use channelUrl instead.")(); } - const parsedPos = position - ? parseInt(position) - : player.currentPosition(); + const parsedPos = position ? parseInt(position) : player.currentPosition(); try { data.result = eval(`player.queue[${parsedPos}].${type}`); } @@ -797,9 +794,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu data.result = null; } return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }, // search { @@ -807,7 +804,7 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu type: "djs", code: async (d) => { const data = d.util.aoiFunc(d); - let [query, type = "youtube", format = "{title} by {artist} ({duration})", list = 5, separator = "\n",] = data.inside.splits; + let [query, type = "youtube", format = "{title} by {artist} ({duration})", list = 5, separator = "\n"] = data.inside.splits; type = type.toLowerCase(); if (!["youtube", "spotify", "soundcloud"].includes(type)) return d.aoiError.fnError(d, "custom", {}, "Type Provided"); @@ -825,35 +822,11 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu let formatResults = format; const placeholders = { "{title}": type === "spotify" ? result.name : result.title, - "{artist}": type === "youtube" - ? result.author.name - : type === "soundcloud" - ? result.publisher_metadata?.artist - : type === "spotify" - ? result.artists[0].name - : "Unknown Artist", - "{duration}": type === "youtube" - ? result.duration.seconds * 1000 - : type === "soundcloud" - ? result.duration - : type === "spotify" - ? result.duration_ms - : 0, - "{digitalFormat}": type === "youtube" - ? result.duration.text - : type === "soundcloud" - ? new Date(result.duration).toISOString().substr(14, 5) - : type === "spotify" - ? new Date(result.duration_ms).toISOString().substr(14, 5) - : "00:00:00", + "{artist}": type === "youtube" ? result.author.name : type === "soundcloud" ? result.publisher_metadata?.artist : type === "spotify" ? result.artists[0].name : "Unknown Artist", + "{duration}": type === "youtube" ? result.duration.seconds * 1000 : type === "soundcloud" ? result.duration : type === "spotify" ? result.duration_ms : 0, + "{digitalFormat}": type === "youtube" ? result.duration.text : type === "soundcloud" ? new Date(result.duration).toISOString().substr(14, 5) : type === "spotify" ? new Date(result.duration_ms).toISOString().substr(14, 5) : "00:00:00", "{id}": result.id, - "{url}": type === "youtube" - ? "https://www.youtube.com/watch?v=" + result.id - : type === "soundcloud" - ? result.permalink_url - : type === "spotify" - ? result.external_urls.spotify - : undefined, + "{url}": type === "youtube" ? "https://www.youtube.com/watch?v=" + result.id : type === "soundcloud" ? result.permalink_url : type === "spotify" ? result.external_urls.spotify : undefined }; for (const placeholder in placeholders) { formatResults = formatResults.replace(new RegExp(placeholder, "g"), placeholders[placeholder]); @@ -862,9 +835,9 @@ _AoiVoice_bot = new WeakMap(), _AoiVoice_events = new WeakMap(), _AoiVoice_execu }); data.result = searchResults.join(separator); return { - code: d.util.setCode(data), + code: d.util.setCode(data) }; - }, + } }); } }; diff --git a/lib/newstruct/aoiVoice.js.map b/lib/newstruct/aoiVoice.js.map index 4954350..6d29cd8 100755 --- a/lib/newstruct/aoiVoice.js.map +++ b/lib/newstruct/aoiVoice.js.map @@ -1 +1 @@ -{"version":3,"file":"aoiVoice.js","sourceRoot":"","sources":["../../src/newstruct/aoiVoice.ts"],"names":[],"mappings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js +++ b/lib/newstruct/audioPlayer.js @@ -43,8 +43,8 @@ class AudioPlayer { filters: [], ytMix: { enabled: false, - lastUrl: null, - }, + lastUrl: null + } }; } async play(emit = true) { @@ -57,26 +57,25 @@ class AudioPlayer { stream = await (0, request_1.requestStream)(current, current?.formattedPlatforms ?? "Youtube", this.options.manager); let s; if (this.options.manager.plugins.has(enums_1.PluginName.Cacher)) { - const Cacher = (this.options.manager.plugins.get(enums_1.PluginName.Cacher)); + const Cacher = this.options.manager.plugins.get(enums_1.PluginName.Cacher); await Cacher.write(current, stream); if (Cacher.type === "disk") stream = Cacher.get(current.id); } - if (this.options.manager.plugins.has(enums_1.PluginName.Filter) && - __classPrivateFieldGet(this, _AudioPlayer_modes, "f").filters.length) { + if (this.options.manager.plugins.has(enums_1.PluginName.Filter) && __classPrivateFieldGet(this, _AudioPlayer_modes, "f").filters.length) { const f = this.options.manager.plugins.get(enums_1.PluginName.Filter); const ffmpeg = f.createFFmpeg("-af", __classPrivateFieldGet(this, _AudioPlayer_modes, "f").filters.join(",")); s = stream.pipe(ffmpeg); resource = (0, voice_1.createAudioResource)(s, { inlineVolume: true, - inputType: voice_1.StreamType.Raw, + inputType: voice_1.StreamType.Raw }); } else { s = stream; resource = (0, voice_1.createAudioResource)(s, { inlineVolume: true, - inputType: voice_1.StreamType.Arbitrary, + inputType: voice_1.StreamType.Arbitrary }); } resource.volume.setVolume(__classPrivateFieldGet(this, _AudioPlayer_modes, "f").volume / 100); @@ -84,7 +83,7 @@ class AudioPlayer { this.player.play(resource); if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix) { if (this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack].id === __classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix.lastUrl) { - const tracks = (await this.options.manager.search(enums_1.PlatformType.Youtube, this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack].id, 3)); + const tracks = await this.options.manager.search(enums_1.PlatformType.Youtube, this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack].id, 3); await this.add(tracks.map((x) => `https://www.youtube.com/watch?v=${x.id}`), enums_1.PlatformType.Youtube, this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack].requester); } } @@ -99,7 +98,7 @@ class AudioPlayer { await this.play(); } async _playNext() { - const Cacher = (this.options.manager.plugins.get(enums_1.PluginName.Cacher)); + const Cacher = this.options.manager.plugins.get(enums_1.PluginName.Cacher); if (this.options.type === "default") { if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack >= 1) { const track = this.queue.shift(); @@ -117,7 +116,7 @@ class AudioPlayer { else if (this.options.type === "fonly") { const track = this.queue.shift(); if (this.options.manager.plugins.has(enums_1.PluginName.Cacher)) { - const Cacher = (this.options.manager.plugins.get(enums_1.PluginName.Cacher)); + const Cacher = this.options.manager.plugins.get(enums_1.PluginName.Cacher); Cacher.delete(track.id); } } @@ -132,18 +131,16 @@ class AudioPlayer { this.player.stop(true); this.options.manager.players.delete(this.options.connection.joinConfig.guildId); if (this.options.manager.plugins.has(enums_1.PluginName.Cacher)) { - const cacher = (this.options.manager.plugins.get(enums_1.PluginName.Cacher)); + const cacher = this.options.manager.plugins.get(enums_1.PluginName.Cacher); cacher.clear(); } } _configPlayer() { this.player.on("stateChange", async (os, ns) => { - if (os.status !== voice_1.AudioPlayerStatus.Idle && - ns.status === voice_1.AudioPlayerStatus.Idle) { + if (os.status !== voice_1.AudioPlayerStatus.Idle && ns.status === voice_1.AudioPlayerStatus.Idle) { if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").paused) { } - else if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").loop === enums_1.LoopMode.Track && - this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack]) { + else if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").loop === enums_1.LoopMode.Track && this.queue[__classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack]) { if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked) { __classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked = false; return; @@ -185,8 +182,7 @@ class AudioPlayer { await this.autoPlayNext(); } } - else if (this.queue.length > 1 && - __classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack < this.queue.length - 1) { + else if (this.queue.length > 1 && __classPrivateFieldGet(this, _AudioPlayer_modes, "f").currentTrack < this.queue.length - 1) { if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked) { __classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked = false; return; @@ -218,10 +214,7 @@ class AudioPlayer { } } } - if (os.status === voice_1.AudioPlayerStatus.Playing && - ns.status !== voice_1.AudioPlayerStatus.Playing && - ns.status !== voice_1.AudioPlayerStatus.Idle && - ns.status !== voice_1.AudioPlayerStatus.Paused) { + if (os.status === voice_1.AudioPlayerStatus.Playing && ns.status !== voice_1.AudioPlayerStatus.Playing && ns.status !== voice_1.AudioPlayerStatus.Idle && ns.status !== voice_1.AudioPlayerStatus.Paused) { if (__classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked) { __classPrivateFieldGet(this, _AudioPlayer_modes, "f").seeked = false; return; @@ -236,12 +229,11 @@ class AudioPlayer { } }); this.player.on("error", async (error) => { + console.log(error); this.options.manager.emit(enums_1.PlayerEvents.AudioError, error, this); }); if (this.options.manager.configs?.devOptions?.debug) { - this.player.on("debug", (msg) => this.options.manager.configs?.devOptions?.debug - ? console.log(msg) - : undefined); + this.player.on("debug", (msg) => (this.options.manager.configs?.devOptions?.debug ? console.log(msg) : undefined)); } this.options.connection.subscribe(this.player); } @@ -249,10 +241,7 @@ class AudioPlayer { for (let i = 0; i < track.length; i++) { if (type === enums_1.PlatformType.Youtube) { const id = track[i].split("?v=")[1].split("&")[0]; - if (track[i].includes("&list=") && - track[i].includes("&index=") && - track.includes("watch?v=") && - !__classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix.enabled) { + if (track[i].includes("&list=") && track[i].includes("&index=") && track.includes("watch?v=") && !__classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix.enabled) { __classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix.enabled = true; __classPrivateFieldGet(this, _AudioPlayer_modes, "f").ytMix.lastUrl = track[track.length - 1]; } @@ -262,7 +251,7 @@ class AudioPlayer { this.queue.push({ ...info, requester: member, - position: this.queue.length, + position: this.queue.length }); this.options.manager.emit(enums_1.PlayerEvents.TrackAdd, info, this); if (this.queue.length === 1) { @@ -278,7 +267,7 @@ class AudioPlayer { this.queue.push({ ...info[i], requester: member, - position: this.queue.length, + position: this.queue.length }); this.options.manager.emit(enums_1.PlayerEvents.TrackAdd, info, this); if (this.queue.length === 1) { @@ -294,7 +283,7 @@ class AudioPlayer { this.queue.push({ ...info, requester: member, - position: this.queue.length, + position: this.queue.length }); this.options.manager.emit(enums_1.PlayerEvents.TrackAdd, info, this); if (this.queue.length === 1) { @@ -303,7 +292,7 @@ class AudioPlayer { } } else if (type === enums_1.PlatformType.Spotify) { - let info = (await (0, request_1.requestInfo)(track[i], "Spotify", this.options.manager)); + let info = await (0, request_1.requestInfo)(track[i], "Spotify", this.options.manager); if (!info) continue; if (!Array.isArray(info)) @@ -314,8 +303,8 @@ class AudioPlayer { ...info[i], requester: member, position: this.queue.length, - thumbnail: moreinfo.coverArt.sources[0].url, - createdAt: new Date(moreinfo.releaseDate.isoString) ?? null, + thumbnail: moreinfo.coverArt ? moreinfo.coverArt.sources[0].url : null, + createdAt: new Date(moreinfo.releaseDate.isoString) ?? null }); this.options.manager.emit(enums_1.PlayerEvents.TrackAdd, info, this); if (this.queue.length === 1) { @@ -329,7 +318,7 @@ class AudioPlayer { this.queue.push({ ...info, requester: member, - position: this.queue.length, + position: this.queue.length }); this.options.manager.emit(enums_1.PlayerEvents.TrackAdd, info, this); if (this.queue.length === 1) { @@ -469,8 +458,7 @@ class AudioPlayer { __classPrivateFieldGet(this, _AudioPlayer_modes, "f").filtering = type; } async autoPlayNext() { - if (this.autoPlay === - enums_1.AutoPlay.Youtube || this.autoPlay === enums_1.AutoPlay.Spotify) { + if (this.autoPlay === enums_1.AutoPlay.Youtube || this.autoPlay === enums_1.AutoPlay.Spotify) { const parsed = await (await (0, undici_1.fetch)(`https://youtube.com/watch?v=${this.currentTrack.id}`)).text(); const data = (0, helpers_1.ytRelatedHTMLParser)(parsed); const ids = (0, helpers_1.YoutubeRelated)(data); @@ -482,7 +470,7 @@ class AudioPlayer { this.queue.push({ ...info, requester: this.currentTrack.requester, - position: this.queue.length, + position: this.queue.length }); } } @@ -499,31 +487,27 @@ class AudioPlayer { this.queue.push({ ...info, requester: this.currentTrack.requester, - position: this.queue.length, + position: this.queue.length }); } } else if (this.autoPlay === enums_1.AutoPlay.Relative) { - if (this.currentTrack.formattedPlatforms.toLowerCase() === - enums_1.AutoPlay.Youtube /*|| this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.Spotify*/) { + if (this.currentTrack.formattedPlatforms.toLowerCase() === enums_1.AutoPlay.Youtube /*|| this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.Spotify*/) { const parsed = await (await (0, undici_1.fetch)(`https://youtube.com/watch?v=${this.currentTrack.id}`)).text(); const data = (0, helpers_1.ytRelatedHTMLParser)(parsed); const ids = (0, helpers_1.YoutubeRelated)(data); for (const id of ids) { - const info = await (0, request_1.requestInfo)(id, this.currentTrack.formattedPlatforms.toLowerCase() === "youtube" - ? "Youtube" - : "Spotify", this.options.manager); + const info = await (0, request_1.requestInfo)(id, this.currentTrack.formattedPlatforms.toLowerCase() === "youtube" ? "Youtube" : "Spotify", this.options.manager); if (!info) continue; this.queue.push({ ...info, requester: this.currentTrack.requester, - position: this.queue.length, + position: this.queue.length }); } } - else if (this.currentTrack.formattedPlatforms.toLowerCase() === - enums_1.AutoPlay.SoundCloud) { + else if (this.currentTrack.formattedPlatforms.toLowerCase() === enums_1.AutoPlay.SoundCloud) { const sc = this.options.manager.platforms.soundcloud; //@ts-ignore const { collection: data } = await sc.related( @@ -536,7 +520,7 @@ class AudioPlayer { this.queue.push({ ...info, requester: this.currentTrack.requester, - position: this.queue.length, + position: this.queue.length }); } } @@ -546,9 +530,7 @@ class AudioPlayer { __configConnection() { this.options.connection.on("stateChange", async (_, newState) => { if (newState.status === voice_1.VoiceConnectionStatus.Disconnected) { - if (newState.reason === - voice_1.VoiceConnectionDisconnectReason.WebSocketClose && - newState.closeCode === 4014) { + if (newState.reason === voice_1.VoiceConnectionDisconnectReason.WebSocketClose && newState.closeCode === 4014) { try { await (0, voice_1.entersState)(this.options.connection, voice_1.VoiceConnectionStatus.Connecting, 5_000); // Probably moved voice channel @@ -581,8 +563,7 @@ class AudioPlayer { this._destroy(); this.player.stop(true); } - else if (newState.status === voice_1.VoiceConnectionStatus.Connecting || - newState.status === voice_1.VoiceConnectionStatus.Signalling) { + else if (newState.status === voice_1.VoiceConnectionStatus.Connecting || newState.status === voice_1.VoiceConnectionStatus.Signalling) { /** * In the Signalling or Connecting states, we set a 20 second time limit for the connection to become ready * before destroying the voice connection. This stops the voice connection permanently existing in one of these @@ -592,8 +573,7 @@ class AudioPlayer { await (0, voice_1.entersState)(this.options.connection, voice_1.VoiceConnectionStatus.Ready, 20_000); } catch { - if (this.options.connection.state.status !== - voice_1.VoiceConnectionStatus.Destroyed) { + if (this.options.connection.state.status !== voice_1.VoiceConnectionStatus.Destroyed) { this._destroy(); this.options.connection.destroy(); } @@ -607,9 +587,7 @@ class AudioPlayer { //start queue from current track and if it is loop queue then push all prev tracks to end of queue const prevTracks = this.queue.slice(0, this.currentPosition()); const nextTracks = this.queue.slice(this.currentPosition()); - let tracks = this.loop === enums_1.LoopMode.Queue - ? [...nextTracks, ...prevTracks] - : nextTracks; + let tracks = this.loop === enums_1.LoopMode.Queue ? [...nextTracks, ...prevTracks] : nextTracks; //add prev tracks behind 0 index with limited length let index = prevTracks.length - 1; let ng = []; @@ -662,7 +640,7 @@ class AudioPlayer { return this.options.connection.ping[type]; } stop() { - this.queue = []; + this.queue.length = 0; this.defaultMode(); this.player.stop(); } diff --git a/lib/newstruct/audioPlayer.js.map b/lib/newstruct/audioPlayer.js.map index 10530da..801775c 100755 --- a/lib/newstruct/audioPlayer.js.map +++ b/lib/newstruct/audioPlayer.js.map @@ -1 +1 @@ -{"version":3,"file":"audioPlayer.js","sourceRoot":"","sources":["../../src/newstruct/audioPlayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAU0B;AAC1B,8CAM4B;AAE5B,iDAI6B;AAW7B,8CAA6C;AAC7C,qDAA6E;AAC7E,iDAI6B;AAI7B,mCAA+B;AAC/B,MAAa,WAAW;IAKtB,YAAY,OAA2B;QAHvC,qCAAwB;QAItB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,uBAAA,IAAI,sBAAU,IAAI,CAAC,WAAW,EAAE,MAAA,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,IAAA,yBAAiB,GAAE,CAAC;QAClC,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IACD,WAAW;QACT,OAAO;YACL,IAAI,EAAE,gBAAQ,CAAC,IAAI;YACnB,eAAe,EAAE,KAAK;YACtB,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,KAAK;YAChB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,GAAG;YACX,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,gBAAQ,CAAC,IAAI;YACvB,OAAO,EAAE,EAAE;YACX,KAAK,EAAE;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,IAAI;aACd;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI;QACpB,IAAI,QAAuB,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAA,IAAI,0BAA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newstruct/cacher.js +++ b/lib/newstruct/cacher.js @@ -36,11 +36,9 @@ class Cacher { __classPrivateFieldSet(this, _Cacher_type, type, "f"); __classPrivateFieldSet(this, _Cacher_path, "MUSIC_CACHE", "f"); __classPrivateFieldSet(this, _Cacher_prefixedPath, ".MUSIC_CACHE", "f"); - if (__classPrivateFieldGet(this, _Cacher_type, "f") === "disk" && - !(0, fs_1.existsSync)(__classPrivateFieldGet(this, _Cacher_path, "f")) && - !(0, fs_1.existsSync)(__classPrivateFieldGet(this, _Cacher_prefixedPath, "f"))) { + if (__classPrivateFieldGet(this, _Cacher_type, "f") === "disk" && !(0, fs_1.existsSync)(__classPrivateFieldGet(this, _Cacher_path, "f")) && !(0, fs_1.existsSync)(__classPrivateFieldGet(this, _Cacher_prefixedPath, "f"))) { (0, fs_1.mkdirSync)(__classPrivateFieldGet(this, _Cacher_path, "f"), { - recursive: true, + recursive: true }); hidefile_1.default.isHidden(__classPrivateFieldGet(this, _Cacher_path, "f"), (err, hidden) => { if (err === null) { @@ -82,10 +80,7 @@ class Cacher { }); } else if (__classPrivateFieldGet(this, _Cacher_type, "f") === "disk") { - const hash = (0, path_1.join)(__classPrivateFieldGet(this, _Cacher_path, "f"), `${metaData.id - .replaceAll("/", "") - .replaceAll(":", "") - .replaceAll(".", "")}.gz`); + const hash = (0, path_1.join)(__classPrivateFieldGet(this, _Cacher_path, "f"), `${metaData.id.replaceAll("/", "").replaceAll(":", "").replaceAll(".", "")}.gz`); if (stream instanceof web_1.ReadableStream) { stream = stream_1.Readable.from(stream); } diff --git a/lib/newstruct/cacher.js.map b/lib/newstruct/cacher.js.map index 56a9a3a..ef98d99 100755 --- a/lib/newstruct/cacher.js.map +++ b/lib/newstruct/cacher.js.map @@ -1 +1 @@ -{"version":3,"file":"cacher.js","sourceRoot":"","sources":["../../src/newstruct/cacher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0CAAgD;AAChD,2BAQY;AACZ,+BAA4B;AAC5B,8CAA2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C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACvB,IAAA,iBAAM,EAAC,IAAA,WAAI,EAAC,uBAAA,IAAI,oBAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YACnC,CAAC;QACL,CAAC;QACD,uBAAA,IAAI,mBAAK,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACD,GAAG,CAAC,EAAU;QACV,OAAO,uBAAA,IAAI,mBAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,GAAG;QACH,OAAO,uBAAA,IAAI,mBAAK,CAAC;IACrB,CAAC;IACD,IAAI,IAAI;QACJ,OAAO,uBAAA,IAAI,oBAAM,CAAC;IACtB,CAAC;IACD,IAAI,IAAI;QACJ,OAAO,uBAAA,IAAI,oBAAM,IAAI,IAAI,CAAC;IAC9B,CAAC;CACJ;AApHD,wBAoHC;6NAjFG,KAAK,oCAAoB,MAA6B,EAAE,IAAY;IAChE,MAAM,IAAI,GAAG,IAAA,iBAAU,GAAE,CAAC;IAC1B,MAAM,IAAA,oBAAS,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAA,sBAAiB,EAAC,IAAI,CAAC,CAAC;IACrC,MAAM,IAAA,mBAAQ,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/lib/newstruct/manager.d.ts b/lib/newstruct/manager.d.ts index 44357cf..b3724b9 100755 --- a/lib/newstruct/manager.d.ts +++ b/lib/newstruct/manager.d.ts @@ -21,7 +21,7 @@ export declare class Manager extends TypedEmitter { spotifyApi: SpotifyWebApi; constructor(config?: ManagerConfigurations); static defaultConfig(): ManagerConfigurations; - joinVc({ type, voiceChannel, selfDeaf, selfMute, adapter, }: { + joinVc({ type, voiceChannel, selfDeaf, selfMute, adapter }: { type: AudioPLayerOptions["type"]; voiceChannel: VoiceBasedChannel; selfDeaf?: boolean; diff --git a/lib/newstruct/manager.js b/lib/newstruct/manager.js index 8168fa0..e4bcb01 100755 --- a/lib/newstruct/manager.js +++ b/lib/newstruct/manager.js @@ -31,7 +31,9 @@ class Manager extends index_1.TypedEmitter { __classPrivateFieldGet(this, _Manager_instances, "m", _Manager_validateConfig).call(this, config); this.configs = config ?? Manager.defaultConfig(); this.players = new Map(); - const ytoptions = {}; + const ytoptions = { + youtubeCookie: "" + }; if (config.searchOptions?.youtubeCookie) { ytoptions.cookie = config.searchOptions?.youtubeCookie; } @@ -39,11 +41,9 @@ class Manager extends index_1.TypedEmitter { ytoptions.cookie = config.searchOptions?.youtubegl ?? "US"; } if (config.searchOptions?.youtubeToken) { - const requestKey = "O43z0dpjhgX20SCx4KAo"; /* * This function generates a YouTube PoToken using BotGuard. * https://github.com/LuanRT/BgUtils/blob/main/examples/node/main.mjs - * */ async function generateYoutubePoToken() { let innertube = await youtubei_js_1.Innertube.create({ retrieve_player: false }); @@ -52,33 +52,45 @@ class Manager extends index_1.TypedEmitter { const dom = new jsdom_1.JSDOM(); Object.assign(globalThis, { window: dom.window, - document: dom.window.document, + document: dom.window.document }); const bgConfig = { - fetch: (url, options) => (0, undici_1.fetch)(url, options), + // @ts-ignore + fetch: (input, init) => (0, undici_1.fetch)(input, init), globalObj: globalThis, identifier: visitorData, - requestKey, + requestKey }; - // @ts-expect-error return bgutils_js_1.BG.Challenge.create(bgConfig) - .then((challenge) => { + .then(async (challenge) => { if (!challenge) throw new Error("[@aoijs/aoi.music]: Could not get challenge, remove the youtubeToken option if this error persists"); - if (challenge.script) { - const script = challenge.script.find((sc) => sc !== null); - if (script) - new Function(script)(); - } - else { - console.warn("[@aoijs/aoi.music]: Failed to load BotGuard."); + const interpreterJavascript = challenge.interpreterJavascript.privateDoNotAccessOrElseSafeScriptWrappedValue; + if (interpreterJavascript) { + new Function(interpreterJavascript)(); } - return bgutils_js_1.BG.PoToken.generate({ - program: challenge.challenge, + else + throw new Error("[aoi.music]: Could not create VM, set the youtubeToken option to 'false' if this error persists"); + const poTokenResult = await bgutils_js_1.BG.PoToken.generate({ + program: challenge.program, globalName: challenge.globalName, - // @ts-ignore - bgConfig, + bgConfig }); + /* + #DEBUG POT generation + const placeholderPoToken = BG.PoToken.generatePlaceholder(visitorData); + + console.info("Session Info:", { + visitorData, + placeholderPoToken, + poToken: poTokenResult.poToken, + integrityTokenData: poTokenResult.integrityTokenData, + }); + */ + if (!poTokenResult.poToken) { + throw new Error("[aoi.music]: Could not generate POT, set the youtubeToken option to 'false' if this error persists"); + } + return poTokenResult.poToken; }) .then((poToken) => { const authPath = (0, path_1.join)(__dirname, "./credentials.json"); @@ -105,22 +117,24 @@ class Manager extends index_1.TypedEmitter { // so people don't get confused about those *absolutely* irrelevant logs youtubei_js_1.Log.setLevel(youtubei_js_1.Log.Level.NONE); const youtubeOptions = { - cache: new youtubei_js_1.UniversalCache(true), + cache: new youtubei_js_1.UniversalCache(true) }; if (ytoptions.potoken?.token && ytoptions.potoken?.visitorData) { youtubeOptions.po_token = ytoptions.potoken.token; youtubeOptions.visitor_data = ytoptions.potoken.visitorData; } + if (ytoptions.youtubeCookie) { + youtubeOptions.cookies = ytoptions.youtubeCookie; + } this.platforms = { youtube: youtubei_js_1.Innertube.create(youtubeOptions), soundcloud: soundcloud_downloader_1.default, - spotify: (0, spotify_url_info_1.default)(undici_1.fetch), + spotify: (0, spotify_url_info_1.default)(undici_1.fetch) }; - if (config.searchOptions?.spotifyAuth?.clientId && - config.searchOptions?.spotifyAuth?.clientSecret) { + if (config.searchOptions?.spotifyAuth?.clientId && config.searchOptions?.spotifyAuth?.clientSecret) { this.spotifyApi = new spotify_web_api_node_1.default({ clientId: config.searchOptions?.spotifyAuth?.clientId, - clientSecret: config.searchOptions?.spotifyAuth?.clientSecret, + clientSecret: config.searchOptions?.spotifyAuth?.clientSecret }); this.spotifyApi.clientCredentialsGrant().then((data) => { this.spotifyApi.setAccessToken(data.body.access_token); @@ -134,98 +148,111 @@ class Manager extends index_1.TypedEmitter { if (config.searchOptions?.soundcloudClientId) { this.platforms.soundcloud.setClientID(config.searchOptions.soundcloudClientId); } + if (config.searchOptions?.youtubeAuth) { + throw new Error("[aoi.music]: 'youtubeAuth' is deprecated, please migrate to the 'youtubeCookie' method. Learn more here: https://github.com/aoijs/aoi.music/wiki/Youtube-Cookies-and-oAuth"); + } + /* Youtube nuked oAuth for non-tv clients if (config.searchOptions?.youtubeAuth === true) { + if (config.searchOptions?.youtubeClient !== "WEB_EMBEDDED") { + throw new Error("[aoi.music]: oAuth2 is only availble for the 'WEB_EMBEDDED' client") + } this.platforms.youtube.then(async (yt) => { // should be inside of node_modules - const authPath = (0, path_1.join)(__dirname, "./credentials.json"); + const authPath = join(__dirname, "./credentials.json"); let authData = {}; - if (!(0, fs_1.existsSync)(authPath)) { - (0, fs_1.writeFileSync)(authPath, "{}"); + + if (!existsSync(authPath)) { + writeFileSync(authPath, "{}"); } - if ((0, fs_1.existsSync)(authPath)) { - const fileContent = (0, fs_1.readFileSync)(authPath, "utf8"); + + if (existsSync(authPath)) { + const fileContent = readFileSync(authPath, "utf8"); authData = JSON.parse(fileContent); } + yt.session.on("auth-pending", (data) => { console.log(`[@aoijs/aoi.music]: Sign in pending: visit ${data.verification_url} and enter ${data.user_code} to sign in.`); }); - const updateCredentials = (credentials) => { - const current = JSON.parse((0, fs_1.readFileSync)(authPath, "utf-8")); + + const updateCredentials = (credentials: Partial) => { + const current: Credentials = JSON.parse(readFileSync(authPath, "utf-8")); + const { visitorData, poToken } = current; - const newCredentials = { + const newCredentials: Credentials = { visitorData, poToken, - ...credentials, + ...credentials }; - (0, fs_1.writeFileSync)(authPath, JSON.stringify(newCredentials)); + + writeFileSync(authPath, JSON.stringify(newCredentials)); }; + yt.session.on("auth", ({ credentials }) => { yt.session.oauth.cacheCredentials(); updateCredentials(credentials); console.log("[@aoijs/aoi.music]: Successfully signed in."); }); + yt.session.on("update-credentials", ({ credentials }) => { yt.session.oauth.cacheCredentials(); updateCredentials(credentials); }); + // check if access_token exists in file, if not skip to signin - if ((0, fs_1.existsSync)(authPath) && - JSON.parse((0, fs_1.readFileSync)(authPath, "utf-8")).access_token) { + if (existsSync(authPath) && JSON.parse(readFileSync(authPath, "utf-8")).access_token) { try { - const credentials = JSON.parse((0, fs_1.readFileSync)(authPath, "utf-8")); + const credentials = JSON.parse(readFileSync(authPath, "utf-8")); // remove unneeded data delete credentials.visitorData; delete credentials.poToken; console.log("[@aoijs/aoi.music]: Attempting to sign in with cached credentials."); await yt.session.signIn(credentials); - } - catch { + } catch { console.warn("[@aoijs/aoi.music]: Failed to sign in with cached credentials, please reauthenticate."); - const { visitorData, poToken } = JSON.parse((0, fs_1.readFileSync)(authPath, "utf-8")); - (0, fs_1.writeFileSync)(authPath, JSON.stringify({ visitorData, poToken }, null, 2)); + const { visitorData, poToken } = JSON.parse(readFileSync(authPath, "utf-8")); + writeFileSync(authPath, JSON.stringify({ visitorData, poToken }, null, 2)); yt.session.oauth.removeCache(); await yt.session.signIn(); } - } - else { + } else { yt.session.signIn(); } }); } + */ } static defaultConfig() { return { devOptions: { - debug: false, + debug: false }, searchOptions: { soundcloudClientId: undefined, youtubeCookie: undefined, - youtubeAuth: true, youtubeToken: true, youtubegl: "US", - youtubeClient: "TV_EMBEDDED", + youtubeClient: "WEB_EMBEDDED", spotifyAuth: { clientId: undefined, - clientSecret: undefined, - }, + clientSecret: undefined + } }, requestOptions: { offsetTimeout: 500, soundcloudLikeTrackLimit: -1, youtubePlaylistLimit: -1, - spotifyPlaylistLimit: -1, - }, + spotifyPlaylistLimit: -1 + } }; } - async joinVc({ type = "default", voiceChannel, selfDeaf = true, selfMute = false, adapter, }) { + async joinVc({ type = "default", voiceChannel, selfDeaf = true, selfMute = false, adapter }) { const data = { channelId: voiceChannel.id, guildId: voiceChannel.guild.id, selfDeaf, selfMute, adapterCreator: (adapter ? adapter : voiceChannel.guild?.voiceAdapterCreator ?? adapter), - group: voiceChannel.client.user.id, + group: voiceChannel.client.user.id }; // destory player if already exists to prevent memory leaks if (this.players.has(data.guildId)) { @@ -243,7 +270,7 @@ class Manager extends index_1.TypedEmitter { connection, voiceChannel: voiceChannel.id, manager: this, - debug: this.configs.devOptions?.debug ?? false, + debug: this.configs.devOptions?.debug ?? false })); if (this.configs.devOptions?.debug) { console.log(`#DEBUG:\n Class -> Manager \n Method -> joinVc \n Message -> Joined Voice Channel ${voiceChannel.name} in Guild ${voiceChannel.guild.name}`); @@ -262,7 +289,7 @@ class Manager extends index_1.TypedEmitter { if (type === enums_1.PlatformType.Youtube) { const yt = await this.platforms.youtube; const res = await yt.search(query, { - type: "video", + type: "video" }); return res.videos.slice(0, limit); } @@ -272,13 +299,13 @@ class Manager extends index_1.TypedEmitter { query, limit, offset: 0, - resourceType: "tracks", + resourceType: "tracks" }); return res.collection; } else if (type === enums_1.PlatformType.Spotify) { const res = await this.spotifyApi.searchTracks(query, { - limit, + limit }); return res.body.tracks.items; } @@ -298,28 +325,19 @@ class Manager extends index_1.TypedEmitter { } exports.Manager = Manager; _Manager_instances = new WeakSet(), _Manager_validateConfig = function _Manager_validateConfig(config) { - if (config.requestOptions?.offsetTimeout && - (typeof config.requestOptions.offsetTimeout !== "number" || - config.requestOptions.offsetTimeout < 0)) { + if (config.requestOptions?.offsetTimeout && (typeof config.requestOptions.offsetTimeout !== "number" || config.requestOptions.offsetTimeout < 0)) { throw new Error(`Invalid Time Provided in ManagerConfig#requestOptions['offsetTimeout']`); } - else if (config.requestOptions?.soundcloudLikeTrackLimit && - (typeof config.requestOptions.soundcloudLikeTrackLimit !== "number" || - config.requestOptions.soundcloudLikeTrackLimit < -1)) { + else if (config.requestOptions?.soundcloudLikeTrackLimit && (typeof config.requestOptions.soundcloudLikeTrackLimit !== "number" || config.requestOptions.soundcloudLikeTrackLimit < -1)) { throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['soundcloudLikeTrackLimit']`); } - else if (config.requestOptions?.youtubePlaylistLimit && - (typeof config.requestOptions.youtubePlaylistLimit !== "number" || - config.requestOptions.youtubePlaylistLimit < -1)) { + else if (config.requestOptions?.youtubePlaylistLimit && (typeof config.requestOptions.youtubePlaylistLimit !== "number" || config.requestOptions.youtubePlaylistLimit < -1)) { throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['youtubePlaylistLimit']`); } - else if (config.requestOptions?.spotifyPlaylistLimit && - (typeof config.requestOptions.spotifyPlaylistLimit !== "number" || - config.requestOptions.spotifyPlaylistLimit < -1)) { + else if (config.requestOptions?.spotifyPlaylistLimit && (typeof config.requestOptions.spotifyPlaylistLimit !== "number" || config.requestOptions.spotifyPlaylistLimit < -1)) { throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['spotifyPlaylistLimit']`); } - else if (config.devOptions?.debug && - typeof config.devOptions.debug !== "boolean") { + else if (config.devOptions?.debug && typeof config.devOptions.debug !== "boolean") { throw new Error(`Invalid Debug Option Provided in ManagerConfig#devOptions['debug']`); } if (config.devOptions?.debug) { diff --git a/lib/newstruct/manager.js.map b/lib/newstruct/manager.js.map index 720f07d..599ae5d 100755 --- a/lib/newstruct/manager.js.map +++ b/lib/newstruct/manager.js.map @@ -1 +1 @@ -{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/newstruct/manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wEAAgD;AAChD,gFAAiD;AACjD,4CAK0B;AAE1B,wDAA4D;AAC5D,6CAA6D;AAQ7D,+CAA4C;AAC5C,kFAAyC;AAEzC,mCAA+B;AAC/B,4CAA4D;AAG5D,iCAA8B;AAC9B,2CAAgC;AAChC,2BAA6D;AAC7D,+BAA4B;AAE5B,MAAa,OAAQ,SAAQ,oBAA2B;IAUtD,YAAY,MAA8B;QACxC,KAAK,EAAE,CAAC;;QAPV,YAAO,GAAwC,IAAI,GAAG,EAGnD,CAAC;QAKF,uBAAA,IAAI,mDAAgB,MAApB,IAAI,EAAiB,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,OA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AAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IAC1G,CAAC;SAAM,IAAI,MAAM,CAAC,cAAc,EAAE,oBAAoB,IAAI,CAAC,OAAO,MAAM,CAAC,cAAc,CAAC,oBAAoB,KAAK,QAAQ,IAAI,MAAM,CAAC,cAAc,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5K,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACtG,CAAC;SAAM,IAAI,MAAM,CAAC,cAAc,EAAE,oBAAoB,IAAI,CAAC,OAAO,MAAM,CAAC,cAAc,CAAC,oBAAoB,KAAK,QAAQ,IAAI,MAAM,CAAC,cAAc,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5K,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACtG,CAAC;SAAM,IAAI,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAClF,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IAC1F,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;AACL,CAAC"} diff --git a/lib/newutils/request.js b/lib/newutils/request.js index 895304d..e49b470 100755 --- a/lib/newutils/request.js +++ b/lib/newutils/request.js @@ -176,15 +176,13 @@ async function requestInfo(id, type, manager) { return generateInfo(id, type); } else if (type === "Youtube") { - const ytData = await (await manager.platforms.youtube).getBasicInfo(id, manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED").catch((_) => undefined); + const ytData = await (await manager.platforms.youtube).getBasicInfo(id, manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED").catch((_) => undefined); if (!ytData) return; return { title: ytData.basic_info.title, channelId: ytData.basic_info.channel_id, artist: ytData.basic_info?.author ?? "Unknown", - // remove soon in favour of channelUrl, better naming - artistURL: `https://youtube.com/channel/${ytData.basic_info.channel_id}`, channelUrl: `https://youtube.com/channel/${ytData.basic_info.channel_id}`, duration: ytData.basic_info.duration * 1000, description: ytData.basic_info.short_description, @@ -215,6 +213,7 @@ async function requestInfo(id, type, manager) { } data = (0, spotify_uri_1.parse)(data); data = await spotify.getData((0, spotify_uri_1.formatOpenURL)(data)); + console.log(require("util").inspect(data, { depth: 1 })); if (data.type === "track") return { title: data.name, @@ -225,7 +224,7 @@ async function requestInfo(id, type, manager) { identifier: "spotify", views: 0, likes: 0, - thumbnail: data.coverArt.sources[0].url, + thumbnail: data.coverArt ? data.coverArt.sources[0].url : null, spotifyId: data.id, id: null, description: null, @@ -274,7 +273,7 @@ async function requestInfo(id, type, manager) { identifier: "spotify", views: 0, likes: 0, - thumbnail: x.coverArt.sources[0].url, + thumbnail: x.coverArt ? x.coverArt.sources[0].url : null, spotifyId: x.id, id: null, description: null, @@ -301,7 +300,7 @@ async function requestInfo(id, type, manager) { identifier: "spotify", views: 0, likes: 0, - thumbnail: x.coverArt.sources[0].url, + thumbnail: x.coverArt ? x.coverArt.sources[0].url : null, spotifyId: x.id, id: null, description: null, @@ -347,7 +346,7 @@ async function requestStream(track, type, manager) { else if (type === "Youtube") { const yt = await manager.platforms.youtube; return stream_1.Readable.fromWeb((await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" }))); @@ -361,14 +360,14 @@ async function requestStream(track, type, manager) { // @ts-ignore track.id = data.videos[0].id; return stream_1.Readable.fromWeb((await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" }))); } else { return stream_1.Readable.fromWeb((await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" }))); diff --git a/lib/newutils/request.js.map b/lib/newutils/request.js.map index e4bb621..73e0665 100755 --- a/lib/newutils/request.js.map +++ b/lib/newutils/request.js.map @@ -1 +1 @@ -{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/newutils/request.ts"],"names":[],"mappings":";;;;;AAkBA,oCA+CC;AAED,wCAqBC;AAED,kCAyNC;AAED,sCA0DC;AA/WD,2CAAiD;AAEjD,2BAAsC;AACtC,kFAAyC;AACzC,mCAAiC;AACjC,8CAA8D;AAC9D,4EAA2D;AAC3D,gDAAwB;AACxB,0CAAmC;AAEnC,6CAAmD;AAEnD,mCAA+C;AAI/C,uCAA4C;AAErC,KAAK,UAAU,YAAY,CAAgC,EAAU,EAAE,IAAO;IACjF,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;SAAM,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,MAAM,IAAA,gBAAO,EAAC,EAAE,CAAC,CAAC;QAClC,IAAI,QAAQ,GAAY,OAAO,CAAC,OAAO,CAAC,cAAc,CAAE,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAC3E,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAe,EAAC,EAAE,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC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YACb,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7B,OAAO,iBAAQ,CAAC,OAAO,CACnB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE;gBACzB,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,aAAa;gBACrE,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,OAAO;aAChB,CAAC,CAAwB,CAC7B,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,OAAO,iBAAQ,CAAC,OAAO,CACnB,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE;gBACzB,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,aAAa;gBACrE,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,OAAO;aAChB,CAAC,CAAwB,CAC7B,CAAC;QACN,CAAC;IACL,CAAC;AACL,CAAC;AAED,kDAAkD"} \ No newline at end of file +{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/newutils/request.ts"],"names":[],"mappings":";;;;;AAkBA,oCA+CC;AAED,wCAqBC;AAED,kCAyNC;AAED,sCA0DC;AA/WD,2CAAiD;AAEjD,2BAAsC;AACtC,kFAAyC;AACzC,mCAAiC;AACjC,8CAA8D;AAC9D,4EAA2D;AAC3D,gDAAwB;AACxB,0CAAmC;AAEnC,6CAAmD;AAEnD,mCAA+C;AAI/C,uCAA4C;AAErC,KAAK,UAAU,YAAY,CAAgC,EAAU,EAAE,IAAO;IACjF,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;SAAM,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAA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aAAa,IAAI,cAAc;gBACtE,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,OAAO;aAChB,CAAC,CAAwB,CAC7B,CAAC;QACN,CAAC;IACL,CAAC;AACL,CAAC;AAED,kDAAkD"} diff --git a/lib/typings/interfaces.d.ts b/lib/typings/interfaces.d.ts index 5734fec..5d632f4 100755 --- a/lib/typings/interfaces.d.ts +++ b/lib/typings/interfaces.d.ts @@ -3,6 +3,7 @@ import { Manager } from "./../newstruct/manager"; import { VoiceConnection } from "@discordjs/voice"; import { AutoPlay, LoopMode, PlayerEvents } from "./enums"; import { AudioPlayer } from "../newstruct/audioPlayer"; +import { Constants } from "youtubei.js"; import { Track, SpotifyTrackInfo, YoutubeTrackInfo, LocalFileTrackInfo, SoundCloudTrackInfo, UrlTrackInfo } from "./types"; export interface ManagerConfigurations { devOptions?: { @@ -14,7 +15,7 @@ export interface ManagerConfigurations { youtubeCookie?: string; youtubeAuth?: boolean; youtubegl?: string; - youtubeClient?: "WEB" | "ANDROID" | "YTMUSIC_ANDROID" | "YTMUSIC" | "YTSTUDIO_ANDROID" | "TV_EMBEDDED"; + youtubeClient?: Exclude; youtubeToken?: boolean; }; requestOptions?: { diff --git a/package-lock.json b/package-lock.json index ba0fc37..ba21283 100755 --- a/package-lock.json +++ b/package-lock.json @@ -9,34 +9,34 @@ "version": "1.2.4", "license": "Apache-2.0", "dependencies": { - "@discordjs/voice": "^0.17.0", + "@discordjs/voice": "^0.18.0", "@ffprobe-installer/ffprobe": "^2.1.2", - "bgutils-js": "^2.1.0", - "discord.js": "^14.16.2", + "bgutils-js": "^3.1.0", + "discord.js": "^14.16.3", "get-audio-duration": "^4.0.1", "hidefile": "^3.0.0", - "jsdom": "^24.1.1", + "jsdom": "^25.0.1", "prism-media": "^1.3.5", "soundcloud-downloader": "^1.0.0", "soundcloud-key-fetch": "^1.0.13", - "spotify-uri": "^4.0.1", - "spotify-url-info": "^3.2.16", + "spotify-uri": "^4.1.0", + "spotify-url-info": "^3.2.18", "spotify-web-api-node": "^5.0.2", "tiny-typed-emitter": "^2.1.0", "tweetnacl": "^1.0.3", - "undici": "^6.19.8", + "undici": "^6.21.0", "youtube-scrapper": "^1.4.0", - "youtubei.js": "^10.5.0" + "youtubei.js": "^11.0.1" }, "devDependencies": { "@discordjs/opus": "^0.9.0", "@types/hidefile": "^3.0.3", - "@types/node": "^22.0.2", + "@types/node": "^22.9.0", "ffmpeg-static": "^5.2.0", "miniget": "^4.2.3", - "typedoc": "^0.26.5", + "typedoc": "^0.26.11", "typedoc-plugin-extras": "^3.1.0", - "typescript": "^5.5.4" + "typescript": "^5.6.3" }, "engines": { "node": ">=18.6.0" @@ -193,6 +193,14 @@ "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz", "integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==" }, + "node_modules/@discordjs/rest/node_modules/undici": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "engines": { + "node": ">=18.17" + } + }, "node_modules/@discordjs/util": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.1.1.tgz", @@ -205,23 +213,28 @@ } }, "node_modules/@discordjs/voice": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.17.0.tgz", - "integrity": "sha512-hArn9FF5ZYi1IkxdJEVnJi+OxlwLV0NJYWpKXsmNOojtGtAZHxmsELA+MZlu2KW1F/K1/nt7lFOfcMXNYweq9w==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.18.0.tgz", + "integrity": "sha512-BvX6+VJE5/vhD9azV9vrZEt9hL1G+GlOdsQaVl5iv9n87fkXjf3cSwllhR3GdaUC8m6dqT8umXIWtn3yCu4afg==", "dependencies": { - "@types/ws": "^8.5.10", - "discord-api-types": "0.37.83", + "@types/ws": "^8.5.12", + "discord-api-types": "^0.37.103", "prism-media": "^1.3.5", - "tslib": "^2.6.2", - "ws": "^8.16.0" + "tslib": "^2.6.3", + "ws": "^8.18.0" }, "engines": { - "node": ">=16.11.0" + "node": ">=18" }, "funding": { "url": "https://github.com/discordjs/discord.js?sponsor" } }, + "node_modules/@discordjs/voice/node_modules/discord-api-types": { + "version": "0.37.105", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.105.tgz", + "integrity": "sha512-TSNlLF5Q9vFLMeHjYskhmDj/zCQ4dFA+OLxQrHUypGW48gt8ttGaB+opCD9w3Zkq1otyoBoetrwaoDFZAFuGng==" + }, "node_modules/@discordjs/ws": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.1.1.tgz", @@ -388,11 +401,11 @@ } }, "node_modules/@types/node": { - "version": "22.5.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", - "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", + "version": "22.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz", + "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@types/unist": { @@ -402,8 +415,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.10", - "license": "MIT", + "version": "8.5.13", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", + "integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==", "dependencies": { "@types/node": "*" } @@ -429,9 +443,9 @@ "license": "ISC" }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "bin": { "acorn": "bin/acorn" }, @@ -499,9 +513,9 @@ "license": "MIT" }, "node_modules/bgutils-js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/bgutils-js/-/bgutils-js-2.1.0.tgz", - "integrity": "sha512-QCUUE/N9NT7zasJahxYdXLixAoxrK+mb6GmQBc9SvAixgeFt+GPW7wJ5Wk0/7JIxcWaKXa/p96CCYWuXyWlUkg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bgutils-js/-/bgutils-js-3.1.0.tgz", + "integrity": "sha512-2S80c/B4OQFubJLD5ddRRp74utrvjA70x9U0RsIVK7gJaDnaPrbw+bnXWxnEnc0euLznmO9jxOtTTC7FxGmv6w==", "funding": [ "https://github.com/sponsors/LuanRT" ] @@ -656,21 +670,16 @@ } }, "node_modules/cssstyle": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", - "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.1.0.tgz", + "integrity": "sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==", "dependencies": { - "rrweb-cssom": "^0.6.0" + "rrweb-cssom": "^0.7.1" }, "engines": { "node": ">=18" } }, - "node_modules/cssstyle/node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==" - }, "node_modules/data-urls": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", @@ -797,9 +806,9 @@ "integrity": "sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA==" }, "node_modules/discord.js": { - "version": "14.16.2", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.2.tgz", - "integrity": "sha512-VGNi9WE2dZIxYM8/r/iatQQ+3LT8STW4hhczJOwm+DBeHq66vsKDCk8trChNCB01sMO9crslYuEMeZl2d7r3xw==", + "version": "14.16.3", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.16.3.tgz", + "integrity": "sha512-EPCWE9OkA9DnFFNrO7Kl1WHHDYFXu3CNVFJg63bfU7hVtjZGyhShwZtSBImINQRWxWP2tgo2XI+QhdXx28r0aA==", "dependencies": { "@discordjs/builders": "^1.9.0", "@discordjs/collection": "1.5.3", @@ -808,7 +817,7 @@ "@discordjs/util": "^1.1.1", "@discordjs/ws": "1.1.1", "@sapphire/snowflake": "3.5.3", - "discord-api-types": "0.37.97", + "discord-api-types": "0.37.100", "fast-deep-equal": "3.1.3", "lodash.snakecase": "4.1.1", "tslib": "^2.6.3", @@ -822,9 +831,17 @@ } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.97", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.97.tgz", - "integrity": "sha512-No1BXPcVkyVD4ZVmbNgDKaBoqgeQ+FJpzZ8wqHkfmBnTZig1FcH3iPPersiK1TUIAzgClh2IvOuVUYfcWLQAOA==" + "version": "0.37.100", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.100.tgz", + "integrity": "sha512-a8zvUI0GYYwDtScfRd/TtaNBDTXwP5DiDVX7K5OmE+DRT57gBqKnwtOC5Ol8z0mRW8KQfETIgiB8U0YZ9NXiCA==" + }, + "node_modules/discord.js/node_modules/undici": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "engines": { + "node": ">=18.17" + } }, "node_modules/dotenv": { "version": "8.6.0", @@ -1319,9 +1336,9 @@ "license": "ISC" }, "node_modules/jintr": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/jintr/-/jintr-2.1.1.tgz", - "integrity": "sha512-89cwX4ouogeDGOBsEVsVYsnWWvWjchmwXBB4kiBhmjOKw19FiOKhNhMhpxhTlK2ctl7DS+d/ethfmuBpzoNNgA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jintr/-/jintr-3.0.2.tgz", + "integrity": "sha512-5g2EBudeJFOopjAX4exAv5OCCW1DgUISfoioCsm1h9Q9HJ41LmnZ6J52PCsqBlQihsmp0VDuxreAVzM7yk5nFA==", "funding": [ "https://github.com/sponsors/LuanRT" ], @@ -1330,11 +1347,11 @@ } }, "node_modules/jsdom": { - "version": "24.1.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.3.tgz", - "integrity": "sha512-MyL55p3Ut3cXbeBEG7Hcv0mVM8pp8PBNWxRqchZnSfAiES1v1mRnMeFfaHWIPULpwsYfvO+ZmMZz5tGCnjzDUQ==", + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", "dependencies": { - "cssstyle": "^4.0.1", + "cssstyle": "^4.1.0", "data-urls": "^5.0.0", "decimal.js": "^10.4.3", "form-data": "^4.0.0", @@ -1347,7 +1364,7 @@ "rrweb-cssom": "^0.7.1", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.4", + "tough-cookie": "^5.0.0", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^3.1.1", @@ -1932,11 +1949,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -1968,11 +1980,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" - }, "node_modules/readable-stream": { "version": "3.6.2", "license": "MIT", @@ -1995,11 +2002,6 @@ "integrity": "sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw==", "dev": true }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" - }, "node_modules/rimraf": { "version": "3.0.2", "devOptional": true, @@ -2174,10 +2176,9 @@ } }, "node_modules/spotify-url-info": { - "version": "3.2.16", - "resolved": "https://registry.npmjs.org/spotify-url-info/-/spotify-url-info-3.2.16.tgz", - "integrity": "sha512-szXt1PLt8lqhaXsTNYH7zPd+EBj6Ha0xtqitqicCijGX6x/jYvn6wgGaK2F1OQfJzx8lxDNfZbtarn4DxzaZ2Q==", - "license": "MIT", + "version": "3.2.18", + "resolved": "https://registry.npmjs.org/spotify-url-info/-/spotify-url-info-3.2.18.tgz", + "integrity": "sha512-apL7H8i+zpj3gnVxXrhEa1H6uBORC2iTExjw808/13Z6mBHJvsF6Dt4ZZF9E+J54n2p7KyGRxnpgm4nEvxsxjQ==", "dependencies": { "himalaya": "~1.1.0", "spotify-uri": "~4.1.0" @@ -2294,18 +2295,31 @@ "version": "2.1.0", "license": "MIT" }, + "node_modules/tldts": { + "version": "6.1.61", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.61.tgz", + "integrity": "sha512-rv8LUyez4Ygkopqn+M6OLItAOT9FF3REpPQDkdMx5ix8w4qkuE7Vo2o/vw1nxKQYmJDV8JpAMJQr1b+lTKf0FA==", + "dependencies": { + "tldts-core": "^6.1.61" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.61", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.61.tgz", + "integrity": "sha512-In7VffkDWUPgwa+c9picLUxvb0RltVwTkSgMNFgvlGSWveCzGBemBqTsgJCL4EDFWZ6WH0fKTsot6yNhzy3ZzQ==" + }, "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", + "integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/tr46": { @@ -2343,9 +2357,9 @@ "license": "MIT" }, "node_modules/typedoc": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.7.tgz", - "integrity": "sha512-gUeI/Wk99vjXXMi8kanwzyhmeFEGv1LTdTQsiyIsmSYsBebvFxhbcyAx7Zjo4cMbpLGxM4Uz3jVIjksu/I2v6Q==", + "version": "0.26.11", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.11.tgz", + "integrity": "sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -2401,9 +2415,9 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2421,9 +2435,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", - "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", + "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", "engines": { "node": ">=18.17" } @@ -2501,23 +2515,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" @@ -2696,15 +2693,15 @@ } }, "node_modules/youtubei.js": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-10.5.0.tgz", - "integrity": "sha512-iyA+VF28c15tCCKH9ExM2RKC3zYiHzA/eixGlJ3vERANkuI+xYKzAZ4vtOhmyqwrAddu88R/DkzEsmpph5NWjg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-11.0.1.tgz", + "integrity": "sha512-ZsbOd+5XF2Ofi3FrLMfYd+f9g9H8xswlouFhjhOqbwT68dMJtX6CRGsHNj5VTFCR/+L/865x1lnUlllB2dDDTA==", "funding": [ "https://github.com/sponsors/LuanRT" ], "dependencies": { "@bufbuild/protobuf": "^2.0.0", - "jintr": "^2.1.1", + "jintr": "^3.0.2", "tslib": "^2.5.0", "undici": "^5.19.1" } diff --git a/package.json b/package.json index 4fe74f9..cdbea64 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aoijs/aoi.music", - "version": "1.2.4", + "version": "1.3.0", "description": "Addition of the Music properties and foundation for aoi.js", "author": { "name": "Leref" @@ -32,34 +32,34 @@ "url": "git+https://github.com/aoijs/aoi.music.git" }, "dependencies": { - "@discordjs/voice": "^0.17.0", + "@discordjs/voice": "^0.18.0", "@ffprobe-installer/ffprobe": "^2.1.2", - "bgutils-js": "^2.1.0", - "discord.js": "^14.16.2", + "bgutils-js": "^3.1.0", + "discord.js": "^14.16.3", "get-audio-duration": "^4.0.1", "hidefile": "^3.0.0", - "jsdom": "^24.1.1", + "jsdom": "^25.0.1", "prism-media": "^1.3.5", "soundcloud-downloader": "^1.0.0", "soundcloud-key-fetch": "^1.0.13", - "spotify-uri": "^4.0.1", - "spotify-url-info": "^3.2.16", + "spotify-uri": "^4.1.0", + "spotify-url-info": "^3.2.18", "spotify-web-api-node": "^5.0.2", "tiny-typed-emitter": "^2.1.0", "tweetnacl": "^1.0.3", - "undici": "^6.19.8", + "undici": "^6.21.0", "youtube-scrapper": "^1.4.0", - "youtubei.js": "^10.5.0" + "youtubei.js": "^11.0.1" }, "devDependencies": { "@discordjs/opus": "^0.9.0", "@types/hidefile": "^3.0.3", - "@types/node": "^22.0.2", + "@types/node": "^22.9.0", "ffmpeg-static": "^5.2.0", "miniget": "^4.2.3", - "typedoc": "^0.26.5", + "typedoc": "^0.26.11", "typedoc-plugin-extras": "^3.1.0", - "typescript": "^5.5.4" + "typescript": "^5.6.3" }, "engines": { "node": ">=18.6.0" diff --git a/src/newstruct/aoiVoice.ts b/src/newstruct/aoiVoice.ts index d66b25e..6949e17 100755 --- a/src/newstruct/aoiVoice.ts +++ b/src/newstruct/aoiVoice.ts @@ -1,1286 +1,868 @@ -import { - Collection, - Message, - Snowflake, - TextBasedChannel, - VoiceChannel, -} from "discord.js"; +import { Collection, Message, Snowflake, TextBasedChannel, VoiceChannel } from "discord.js"; import { shuffle } from "../newutils/helpers"; import { search } from "../newutils/search"; -import { - LoopMode, - PlatformType, - PlayerEvents, - PluginName, -} from "../typings/enums"; -import { - AudioPLayerOptions, - ManagerConfigurations, -} from "../typings/interfaces"; +import { LoopMode, PlatformType, PlayerEvents, PluginName } from "../typings/enums"; +import { AudioPLayerOptions, ManagerConfigurations } from "../typings/interfaces"; import { AudioPlayer } from "./audioPlayer"; import { Filter } from "./filter"; import { Manager } from "./manager"; import { CustomFilters } from "../newutils/constants"; export class AoiVoice extends Manager { - #bot: T; - prunes: Map< - Snowflake, - { - message: Message; - channel: Snowflake; - } - >; - cmds: { - trackStart: Collection>; - trackEnd: Collection>; - trackAdd: Collection>; - queueEnd: Collection>; - audioError: Collection>; - queueStart: Collection>; - trackPause: Collection>; - trackResume: Collection>; - }; - #events: PlayerEvents[]; - #executor: Function; - constructor(bot: T, managerConfig?: ManagerConfigurations) { - super(managerConfig); - this.#bot = bot; - this.prunes = new Map(); - //@ts-ignore - this.#bot.voiceManager = this; - this.cmds = { - [PlayerEvents.TrackStart]: new Collection< - Snowflake, - Record - >(), - [PlayerEvents.TrackEnd]: new Collection>(), - [PlayerEvents.TrackAdd]: new Collection>(), - [PlayerEvents.QueueEnd]: new Collection>(), - [PlayerEvents.AudioError]: new Collection< - Snowflake, - Record - >(), - [PlayerEvents.QueueStart]: new Collection< - Snowflake, - Record - >(), - [PlayerEvents.TrackPause]: new Collection< - Snowflake, - Record - >(), - [PlayerEvents.TrackResume]: new Collection< + #bot: T; + prunes: Map< Snowflake, - Record - >(), + { + message: Message; + channel: Snowflake; + } + >; + cmds: { + trackStart: Collection>; + trackEnd: Collection>; + trackAdd: Collection>; + queueEnd: Collection>; + audioError: Collection>; + queueStart: Collection>; + trackPause: Collection>; + trackResume: Collection>; }; - this.#events = []; - this.#executor = () => {}; - this.#bindFunctions(); - } - addEvent(event: PlayerEvents) { - this.#events.push(event); - this.#bindEvents(event); - } - addEvents(...events: PlayerEvents[]) { - this.#events.push(...events); - for (const event of events) { - this.#bindEvents(event); + #events: PlayerEvents[]; + #executor: Function; + constructor(bot: T, managerConfig?: ManagerConfigurations) { + super(managerConfig); + this.#bot = bot; + this.prunes = new Map(); + //@ts-ignore + this.#bot.voiceManager = this; + this.cmds = { + [PlayerEvents.TrackStart]: new Collection>(), + [PlayerEvents.TrackEnd]: new Collection>(), + [PlayerEvents.TrackAdd]: new Collection>(), + [PlayerEvents.QueueEnd]: new Collection>(), + [PlayerEvents.AudioError]: new Collection>(), + [PlayerEvents.QueueStart]: new Collection>(), + [PlayerEvents.TrackPause]: new Collection>(), + [PlayerEvents.TrackResume]: new Collection>() + }; + this.#events = []; + this.#executor = () => {}; + this.#bindFunctions(); } - } - bindExecutor(executor: Function) { - this.#executor = executor; - } - #bindEvents(event: PlayerEvents) { - this.on(event, (...data: any[]) => { - const player: AudioPlayer = data.pop(); - this.cmds[event].forEach(async (cmd) => { - if (!cmd.__compiled__) { - let channel: TextBasedChannel; - if (cmd.channel.startsWith("$")) { - channel = ( - await this.#executor( - this.#bot, - { - // @ts-ignore - guild: this.#bot.guilds.cache.get( - player.options.connection.joinConfig.guildId - ), - // @ts-ignore - channel: this.#bot.channels.cache.get( - this.prunes.get( - player.options.connection.joinConfig.guildId - ).channel - ), - }, - [], - { code: cmd.channel, name: "NameParser" }, - undefined, - true, - undefined, - { - data: data[0], - player: player, - } - ) - )?.code; - } - //@ts-ignore - channel = this.#bot.channels.cache.get(channel); - return await this.#executor( - this.#bot, - { - // @ts-ignore - guild: this.#bot.guilds.cache.get( - player.options.connection.joinConfig.guildId - ), - // @ts-ignore - channel: this.#bot.channels.cache.get( - this.prunes.get(player.options.connection.joinConfig.guildId) - .channel - ), - }, - [], - cmd, - undefined, - false, - channel, - { - data: data[0], - } - ); - } else { - return await cmd.__compiled__({ - bot: this.#bot, - client: (this.#bot).client, - channel: this.prunes.get( - player.options.connection.joinConfig.guildId - ).channel, - guild: (this.#bot).guilds.cache.get( - player.options.connection.joinConfig.guildId - ), - player: player, - }); + addEvent(event: PlayerEvents) { + this.#events.push(event); + this.#bindEvents(event); + } + addEvents(...events: PlayerEvents[]) { + this.#events.push(...events); + for (const event of events) { + this.#bindEvents(event); } - }); - return PlayerEvents[event]; - }); - } - async joinVc({ - type = "default", - voiceChannel, - textChannel, - selfDeaf = true, - selfMute = false, - }: { - type: AudioPLayerOptions["type"]; - voiceChannel: VoiceChannel; - textChannel: Snowflake; - selfDeaf?: boolean; - selfMute?: boolean; - }) { - await super - .joinVc({ - type, - voiceChannel, - selfDeaf, - selfMute, - }) - .catch((e) => false); - this.prunes.set(voiceChannel.guild.id, { - message: null, - channel: textChannel, - }); - return true; - } - #bindFunctions() { - // @ts-ignore - if (this.#bot.functionManager) { - // @ts-ignore - if (this.#bot.functionManager.createCustomFunction) { + } + bindExecutor(executor: Function) { + this.#executor = executor; + } + #bindEvents(event: PlayerEvents) { + this.on(event, (...data: any[]) => { + const player: AudioPlayer = data.pop(); + this.cmds[event].forEach(async (cmd) => { + if (!cmd.__compiled__) { + let channel: TextBasedChannel; + if (cmd.channel.startsWith("$")) { + channel = ( + await this.#executor( + this.#bot, + { + // @ts-ignore + guild: this.#bot.guilds.cache.get(player.options.connection.joinConfig.guildId), + // @ts-ignore + channel: this.#bot.channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId).channel) + }, + [], + { code: cmd.channel, name: "NameParser" }, + undefined, + true, + undefined, + { + data: data[0], + player: player + } + ) + )?.code; + } + //@ts-ignore + channel = this.#bot.channels.cache.get(channel); + return await this.#executor( + this.#bot, + { + // @ts-ignore + guild: this.#bot.guilds.cache.get(player.options.connection.joinConfig.guildId), + // @ts-ignore + channel: this.#bot.channels.cache.get(this.prunes.get(player.options.connection.joinConfig.guildId).channel) + }, + [], + cmd, + undefined, + false, + channel, + { + data: data[0] + } + ); + } else { + return await cmd.__compiled__({ + bot: this.#bot, + client: (this.#bot).client, + channel: this.prunes.get(player.options.connection.joinConfig.guildId).channel, + guild: (this.#bot).guilds.cache.get(player.options.connection.joinConfig.guildId), + player: player + }); + } + }); + return PlayerEvents[event]; + }); + } + async joinVc({ type = "default", voiceChannel, textChannel, selfDeaf = true, selfMute = false }: { type: AudioPLayerOptions["type"]; voiceChannel: VoiceChannel; textChannel: Snowflake; selfDeaf?: boolean; selfMute?: boolean }) { + await super + .joinVc({ + type, + voiceChannel, + selfDeaf, + selfMute + }) + .catch((e) => false); + this.prunes.set(voiceChannel.guild.id, { + message: null, + channel: textChannel + }); + return true; + } + #bindFunctions() { // @ts-ignore - this.#bot.functionManager.createFunction = - // @ts-ignore - this.#bot.functionManager.createCustomFunction; - } - //@ts-ignore - this.#bot.functionManager.createFunction( - //join - { - name: "$joinVC", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - let [ - voiceId = d.member?.voice?.channelId, - selfDeaf = "true", - selfMute = "false", - speaker = "true", - audioPlayerType = "default", - debug = "false", - ] = data.inside.splits; - - const vc = await d.util.getChannel(d, voiceId); - if (!vc) - return d.aoiError.fnError( - d, - "custom", - { inside: data.inside }, - "Invalid Channel ID Provided" - ); - if ( - ![d.util.channelTypes.Voice, d.util.channelTypes.Stage].includes( - vc.type - ) - ) - return d.aoiError.fnError( - d, - "custom", - { inside: data.inside }, - "Provided channelID is not Voice/Stage Channel In" - ); - - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - try { - await d.client.voiceManager.joinVc({ - type: audioPlayerType, - voiceChannel: vc, - textChannel: d.channel.id, - selfMute: selfMute === "true", - selfDeaf: selfDeaf === "true", - debug: debug === "true", - }); - if (speaker === "true" && vc.type === d.util.channelTypes.Stage) { - await (d.guild.me ?? d.guild.members.me).voice.setSuppressed( - false - ); - } - } catch (e) { - d.aoiError.fnError( - d, - "custom", - {}, - "Failed To Join VC With Reason: " + e - ); - } - - return { - code: d.util.setCode(data), - }; - }, - }, - //leave - { - name: "$leaveVC", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [guildId = d.guild?.id] = data.inside.splits; - const guild = await d.util.getGuild(d, guildId); - if (!guild) - return d.aoiError.fnError(d, "guild", { inside: data.inside }); - - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(guild.id); - if (player) d.client.voiceManager.leaveVc(guild.id); - - return { - code: d.util.setCode(data), - }; - }, - }, - //play - { - name: "$playTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [track, type] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - let tracks: string[] = []; - let trackType: number; - - if (type === "youtube") { - tracks = await search( - track.addBrackets(), - PlatformType.Youtube, - this - ); - trackType = PlatformType.Youtube; - } else if (type === "soundcloud") { - tracks = await search( - track.addBrackets(), - PlatformType.SoundCloud, - this - ); - trackType = PlatformType.SoundCloud; - } else if (type === "spotify") { - tracks = await search( - track.addBrackets(), - PlatformType.Spotify, - this - ); - trackType = PlatformType.Spotify; - } else if (type === "local") { - tracks = await search( - track.addBrackets(), - PlatformType.LocalFile, - this - ); - trackType = PlatformType.LocalFile; - } else if (type === "url") { - tracks = await search( - track.addBrackets(), - PlatformType.Url, - this - ); - trackType = PlatformType.Url; - } else { - return d.aoiError.fnError( - d, - "custom", - {}, - "Invalid Type Provided." - ); - } - - if (tracks?.length !== 0) - await player.add(tracks, trackType, d.member); - - return { - code: d.util.setCode(data), - }; - }, - }, - //queue - { - name: "$queue", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [ - page = 1, - limit = 10, - format = `{position}) {title} | {requester.user.tag}`, - sep = ",", - ] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const hasPlayer = d.client.voiceManager.players.has(d.guild.id); - if (!hasPlayer) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - const player = d.client.voiceManager.players.get(d.guild.id); - - data.result = player.getQueue(page, limit, format).join(sep); - - return { - code: d.util.setCode(data), - }; - }, - }, - // autoplay - { - name: "$autoPlay", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [type = "youtube"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if ( - ![ - "relative", - "youtube", - "soundcloud", - "spotify", - "none", - ].includes(type.toLowerCase()) - ) { - return d.aoiError.fnError( - d, - "custom", - { inside: data.inside }, - "Invalid Type Provided in" - ); - } - - player.autoPlay = type.toLowerCase(); - - return { - code: d.util.setCode(data), - }; - }, - }, - //addFilter - { - name: "$addFilter", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [filter, returnfilters = "false"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (!this.plugins.get(PluginName.Filter)) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - } - - const ffilter = this.plugins.get(PluginName.Filter); - let parsed = JSON.parse(filter); - const keys = Object.keys(parsed); - const result = []; - for (const key of keys) { - if (CustomFilters[key]) { - result.push(...CustomFilters[key](parsed[key])); - } else { - result.push({ - filter: key, - value: parsed[key], - }); - } - } - ffilter.add(result, player); - - data.result = returnfilters === "true" ? result : null; - - return { - code: d.util.setCode(data), - }; - }, - }, - //setFilter - { - name: "$setFilter", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [filter, returnfilters = "false"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (!this.plugins.get(PluginName.Filter)) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - } - - const ffilter = this.plugins.get(PluginName.Filter); - let parsed = JSON.parse(filter); - const keys = Object.keys(parsed); - const result = []; - for (const key of keys) { - if (CustomFilters[key]) { - result.push(...CustomFilters[key](parsed[key])); - } else { - result.push({ - filter: key, - value: parsed[key], - }); - } - } - ffilter.set(result, player); - - data.result = returnfilters === "true" ? result : null; - - return { - code: d.util.setCode(data), - }; - }, - }, - //removeFilter - { - name: "$removeFilter", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [filter, returnfilters = "false"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (!this.plugins.get(PluginName.Filter)) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - } - - const ffilter = this.plugins.get(PluginName.Filter); - if (CustomFilters[filter]) { - for (const f of CustomFilters[filter]()) { - ffilter.remove(f.filter, player); - } - } else { - ffilter.remove(filter, player); - } - - data.result = returnfilters === "true" ? player.filters : null; - - return { - code: d.util.setCode(data), - }; - }, - }, - //resetFilter - { - name: "$resetFilter", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (!this.plugins.get(PluginName.Filter)) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - } - const ffilter = this.plugins.get(PluginName.Filter); - - ffilter.removeAll(player); - - return { - code: d.util.setCode(data), - }; - }, - }, - //getFilters - { - name: "$getFilters", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (!this.plugins.get(PluginName.Filter)) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - } - - data.result = player.filters; - - return { - code: d.util.setCode(data), - }; - }, - }, - //volume - { - name: "$volume", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [volume = "get"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - if (volume === "get") { - data.result = player.volume; - } else { - player.volume = Number(volume); - } - - return { - code: d.util.setCode(data), - }; - }, - }, - //seek - { - name: "$seek", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [time] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - - const ffilter = this.plugins.get(PluginName.Filter); - if (!ffilter) - return d.aoiError.fnError( - d, - "custom", - {}, - "Filter Plugin Not Found." - ); - - ffilter.seek(Number(time), player); - return { - code: d.util.setCode(data), - }; - }, - }, - //getCurrentTrackDuration - { - name: "$getCurrentTrackDuration", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (player) data.result = player.getTrackCurrentDuration(); - - return { - code: d.util.setCode(data), - }; - }, - }, - //hasplayer - { - name: "$hasPlayer", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - data.result = d.client.voiceManager.players.has(d.guild.id); - return { - code: d.util.setCode(data), - }; - }, - }, - // loopMode - { - name: "$loopMode", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [mode = "queue"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) { - if ( - ![LoopMode.None, LoopMode.Track, LoopMode.Queue].includes(mode) - ) { - return d.aoiError.fnError( - d, - "custom", - {}, - "Invalid Loop Mode." - ); - } - player.loop = mode; - } - - return { - code: d.util.setCode(data), - }; - }, - }, - //loopStatus - { - name: "$loopStatus", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (player) data.result = player.loop; - - return { - code: d.util.setCode(data), - }; - }, - }, - //ClearQueue - { - name: "$clearQueue", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.queue = []; - - return { - code: d.util.setCode(data), - }; - }, - }, - //pauseTrack - { - name: "$pauseTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.pause(); - - return { - code: d.util.setCode(data), - }; - }, - }, - //resumeTrack - { - name: "$resumeTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.resume(); - - return { - code: d.util.setCode(data), - }; - }, - }, - // removeTrack - { - name: "$removeTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (data.err) return d.error(data.err); - - const position = data.inside.inside; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (isNaN(position)) - return d.aoiError.fnError( - d, - "custom", - {}, - "Invalid Position Provided." - ); - - if (player) player.removeTrack(Number(position)); - - return { - code: d.util.setCode(data), - }; - }, - }, - // stopTrack - { - name: "$stopTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.stop(); - - return { - code: d.util.setCode(data), - }; - }, - }, - //skipTrack - { - name: "$skipTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.skip(); - - return { - code: d.util.setCode(data), - }; - }, - }, - // skipTo - { - name: "$skipTo", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [index] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (player) { - if (isNaN(index)) { - return d.aoiError.fnError(d, "custom", {}, "Invalid Index."); - } - player.skipTo(index); - } - return { - code: d.util.setCode(data), - }; - }, - }, - // playPreviousTrack - { - name: "$playPreviousTrack", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.playPrevious(); - - return { - code: d.util.setCode(data), - }; - }, - }, - // queueLength - { - name: "$queueLength", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) data.result = player.queue.length ?? 0; - - return { - code: d.util.setCode(data), - }; - }, - }, - // voicePing - { - name: "$voicePing", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const [type = "ws"] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (!["ws", "upd"].includes(type)) { - return d.aoiError.fnError(d, "custom", {}, "Invalid Type."); - } - - if (player) data.result = player.getPing(type); - - return { - code: d.util.setCode(data), - }; - }, - }, - // playerStatus - { - name: "$playerStatus", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (player) data.result = player.player._state.status; - return { - code: d.util.setCode(data), - }; - }, - }, - // stop - { - name: "$stopPlayer", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player._destroy(); - - return { - code: d.util.setCode(data), - }; - }, - }, - // shuffleQueue - { - name: "$shuffleQueue", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - - if (player) player.queue = shuffle(player.queue); - - return { - code: d.util.setCode(data), - }; - }, - }, - //unshuffleQueue - { - name: "$unshuffleQueue", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - const player = d.client.voiceManager.players.get(d.guild.id); - if (player) { - player.queue = player.queue.sort( - (a: { position: number }, b: { position: number }) => - a.position - b.position - ); - } - return { - code: d.util.setCode(data), - }; - }, - }, - // songInfo - { - name: "$songInfo", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - const util = require("util"); - const [type = "title", position] = data.inside.splits; - if (!d.client.voiceManager) - return d.aoiError.fnError( - d, - "custom", - {}, - "Voice Class Is Not Initialised." - ); - - const player = d.client.voiceManager.players.get(d.guild.id); - if (!player) - return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); - if (!player.queue.length) - return d.aoiError.fnError(d, "custom", {}, "No Song Is Playing."); - if (!type) - return d.aoiError.fnError(d, "custom", {}, "Invalid Type."); - - if (type === "artistURL") { - util.deprecate(() => {}, - "artistURL is deprecated. Please use channelUrl instead.")(); + if (this.#bot.functionManager) { + // @ts-ignore + if (this.#bot.functionManager.createCustomFunction) { + // @ts-ignore + this.#bot.functionManager.createFunction = + // @ts-ignore + this.#bot.functionManager.createCustomFunction; } + //@ts-ignore + this.#bot.functionManager.createFunction( + //join + { + name: "$joinVC", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + let [voiceId = d.member?.voice?.channelId, selfDeaf = "true", selfMute = "false", speaker = "true", audioPlayerType = "default", debug = "false"] = data.inside.splits; + + const vc = await d.util.getChannel(d, voiceId); + if (!vc) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Invalid Channel ID Provided"); + if (![d.util.channelTypes.Voice, d.util.channelTypes.Stage].includes(vc.type)) return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Provided channelID is not Voice/Stage Channel In"); + + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + try { + await d.client.voiceManager.joinVc({ + type: audioPlayerType, + voiceChannel: vc, + textChannel: d.channel.id, + selfMute: selfMute === "true", + selfDeaf: selfDeaf === "true", + debug: debug === "true" + }); + if (speaker === "true" && vc.type === d.util.channelTypes.Stage) { + await (d.guild.me ?? d.guild.members.me).voice.setSuppressed(false); + } + } catch (e) { + d.aoiError.fnError(d, "custom", {}, "Failed To Join VC With Reason: " + e); + } + + return { + code: d.util.setCode(data) + }; + } + }, + //leave + { + name: "$leaveVC", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [guildId = d.guild?.id] = data.inside.splits; + const guild = await d.util.getGuild(d, guildId); + if (!guild) return d.aoiError.fnError(d, "guild", { inside: data.inside }); + + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(guild.id); + if (player) d.client.voiceManager.leaveVc(guild.id); + + return { + code: d.util.setCode(data) + }; + } + }, + //play + { + name: "$playTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [track, type] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + let tracks: string[] = []; + let trackType: number; + + if (type === "youtube") { + tracks = await search(track.addBrackets(), PlatformType.Youtube, this); + trackType = PlatformType.Youtube; + } else if (type === "soundcloud") { + tracks = await search(track.addBrackets(), PlatformType.SoundCloud, this); + trackType = PlatformType.SoundCloud; + } else if (type === "spotify") { + tracks = await search(track.addBrackets(), PlatformType.Spotify, this); + trackType = PlatformType.Spotify; + } else if (type === "local") { + tracks = await search(track.addBrackets(), PlatformType.LocalFile, this); + trackType = PlatformType.LocalFile; + } else if (type === "url") { + tracks = await search(track.addBrackets(), PlatformType.Url, this); + trackType = PlatformType.Url; + } else { + return d.aoiError.fnError(d, "custom", {}, "Invalid Type Provided."); + } + + if (tracks?.length !== 0) await player.add(tracks, trackType, d.member); + + return { + code: d.util.setCode(data) + }; + } + }, + //queue + { + name: "$queue", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [page = 1, limit = 10, format = `{position}) {title} | {requester.user.tag}`, sep = ","] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const hasPlayer = d.client.voiceManager.players.has(d.guild.id); + if (!hasPlayer) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + const player = d.client.voiceManager.players.get(d.guild.id); + + data.result = player.getQueue(page, limit, format).join(sep); + + return { + code: d.util.setCode(data) + }; + } + }, + // autoplay + { + name: "$autoPlay", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [type = "youtube"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!["relative", "youtube", "soundcloud", "spotify", "none"].includes(type.toLowerCase())) { + return d.aoiError.fnError(d, "custom", { inside: data.inside }, "Invalid Type Provided in"); + } + + player.autoPlay = type.toLowerCase(); + + return { + code: d.util.setCode(data) + }; + } + }, + //addFilter + { + name: "$addFilter", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [filter, returnfilters = "false"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!this.plugins.get(PluginName.Filter)) { + return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + } + + const ffilter = this.plugins.get(PluginName.Filter); + let parsed = JSON.parse(filter); + const keys = Object.keys(parsed); + const result = []; + for (const key of keys) { + if (CustomFilters[key]) { + result.push(...CustomFilters[key](parsed[key])); + } else { + result.push({ + filter: key, + value: parsed[key] + }); + } + } + ffilter.add(result, player); + + data.result = returnfilters === "true" ? result : null; + + return { + code: d.util.setCode(data) + }; + } + }, + //setFilter + { + name: "$setFilter", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [filter, returnfilters = "false"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!this.plugins.get(PluginName.Filter)) { + return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + } + + const ffilter = this.plugins.get(PluginName.Filter); + let parsed = JSON.parse(filter); + const keys = Object.keys(parsed); + const result = []; + for (const key of keys) { + if (CustomFilters[key]) { + result.push(...CustomFilters[key](parsed[key])); + } else { + result.push({ + filter: key, + value: parsed[key] + }); + } + } + ffilter.set(result, player); + + data.result = returnfilters === "true" ? result : null; + + return { + code: d.util.setCode(data) + }; + } + }, + //removeFilter + { + name: "$removeFilter", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [filter, returnfilters = "false"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!this.plugins.get(PluginName.Filter)) { + return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + } + + const ffilter = this.plugins.get(PluginName.Filter); + if (CustomFilters[filter]) { + for (const f of CustomFilters[filter]()) { + ffilter.remove(f.filter, player); + } + } else { + ffilter.remove(filter, player); + } + + data.result = returnfilters === "true" ? player.filters : null; + + return { + code: d.util.setCode(data) + }; + } + }, + //resetFilter + { + name: "$resetFilter", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!this.plugins.get(PluginName.Filter)) { + return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + } + const ffilter = this.plugins.get(PluginName.Filter); + + ffilter.removeAll(player); + + return { + code: d.util.setCode(data) + }; + } + }, + //getFilters + { + name: "$getFilters", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (!this.plugins.get(PluginName.Filter)) { + return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + } + + data.result = player.filters; + + return { + code: d.util.setCode(data) + }; + } + }, + //volume + { + name: "$volume", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [volume = "get"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + if (volume === "get") { + data.result = player.volume; + } else { + player.volume = Number(volume); + } + + return { + code: d.util.setCode(data) + }; + } + }, + //seek + { + name: "$seek", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [time] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + + const ffilter = this.plugins.get(PluginName.Filter); + if (!ffilter) return d.aoiError.fnError(d, "custom", {}, "Filter Plugin Not Found."); + + ffilter.seek(Number(time), player); + return { + code: d.util.setCode(data) + }; + } + }, + //getCurrentTrackDuration + { + name: "$getCurrentTrackDuration", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (player) data.result = player.getTrackCurrentDuration(); + + return { + code: d.util.setCode(data) + }; + } + }, + //hasplayer + { + name: "$hasPlayer", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + data.result = d.client.voiceManager.players.has(d.guild.id); + return { + code: d.util.setCode(data) + }; + } + }, + // loopMode + { + name: "$loopMode", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [mode = "queue"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) { + if (![LoopMode.None, LoopMode.Track, LoopMode.Queue].includes(mode)) { + return d.aoiError.fnError(d, "custom", {}, "Invalid Loop Mode."); + } + player.loop = mode; + } + + return { + code: d.util.setCode(data) + }; + } + }, + //loopStatus + { + name: "$loopStatus", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (player) data.result = player.loop; + + return { + code: d.util.setCode(data) + }; + } + }, + //ClearQueue + { + name: "$clearQueue", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.queue = []; + + return { + code: d.util.setCode(data) + }; + } + }, + //pauseTrack + { + name: "$pauseTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.pause(); + + return { + code: d.util.setCode(data) + }; + } + }, + //resumeTrack + { + name: "$resumeTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.resume(); + + return { + code: d.util.setCode(data) + }; + } + }, + // removeTrack + { + name: "$removeTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (data.err) return d.error(data.err); - const parsedPos = position - ? parseInt(position) - : player.currentPosition(); - try { - data.result = eval(`player.queue[${parsedPos}].${type}`); - } catch (error) { - data.result = null; - } - return { - code: d.util.setCode(data), - }; - }, - }, - // search - { - name: "$search", - type: "djs", - code: async (d: any) => { - const data = d.util.aoiFunc(d); - let [ - query, - type = "youtube", - format = "{title} by {artist} ({duration})", - list = 5, - separator = "\n", - ] = data.inside.splits; - - type = type.toLowerCase(); - - if (!["youtube", "spotify", "soundcloud"].includes(type)) - return d.aoiError.fnError(d, "custom", {}, "Type Provided"); - - let results: any[] = []; - - if (type === "youtube") { - results = await d.client.voiceManager.search(3, query, list); - } else if (type === "soundcloud") { - results = await d.client.voiceManager.search(0, query, list); - } else if (type === "spotify") { - results = await d.client.voiceManager.search(4, query, list); - } + const position = data.inside.inside; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); - const searchResults = results.map((result) => { - let formatResults = format; - - const placeholders = { - "{title}": type === "spotify" ? result.name : result.title, - "{artist}": - type === "youtube" - ? result.author.name - : type === "soundcloud" - ? result.publisher_metadata?.artist - : type === "spotify" - ? result.artists[0].name - : "Unknown Artist", - "{duration}": - type === "youtube" - ? result.duration.seconds * 1000 - : type === "soundcloud" - ? result.duration - : type === "spotify" - ? result.duration_ms - : 0, - "{digitalFormat}": - type === "youtube" - ? result.duration.text - : type === "soundcloud" - ? new Date(result.duration).toISOString().substr(14, 5) - : type === "spotify" - ? new Date(result.duration_ms).toISOString().substr(14, 5) - : "00:00:00", - "{id}": result.id, - "{url}": - type === "youtube" - ? "https://www.youtube.com/watch?v=" + result.id - : type === "soundcloud" - ? result.permalink_url - : type === "spotify" - ? result.external_urls.spotify - : undefined, - }; - - for (const placeholder in placeholders) { - formatResults = formatResults.replace( - new RegExp(placeholder, "g"), - placeholders[placeholder] - ); - } - - return formatResults; - }); + if (isNaN(position)) return d.aoiError.fnError(d, "custom", {}, "Invalid Position Provided."); - data.result = searchResults.join(separator); + if (player) player.removeTrack(Number(position)); - return { - code: d.util.setCode(data), - }; - }, + return { + code: d.util.setCode(data) + }; + } + }, + // stopTrack + { + name: "$stopTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.stop(); + + return { + code: d.util.setCode(data) + }; + } + }, + //skipTrack + { + name: "$skipTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.skip(); + + return { + code: d.util.setCode(data) + }; + } + }, + // skipTo + { + name: "$skipTo", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [index] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (player) { + if (isNaN(index)) { + return d.aoiError.fnError(d, "custom", {}, "Invalid Index."); + } + player.skipTo(index); + } + return { + code: d.util.setCode(data) + }; + } + }, + // playPreviousTrack + { + name: "$playPreviousTrack", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.playPrevious(); + + return { + code: d.util.setCode(data) + }; + } + }, + // queueLength + { + name: "$queueLength", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) data.result = player.queue.length ?? 0; + + return { + code: d.util.setCode(data) + }; + } + }, + // voicePing + { + name: "$voicePing", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const [type = "ws"] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (!["ws", "upd"].includes(type)) { + return d.aoiError.fnError(d, "custom", {}, "Invalid Type."); + } + + if (player) data.result = player.getPing(type); + + return { + code: d.util.setCode(data) + }; + } + }, + // playerStatus + { + name: "$playerStatus", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (player) data.result = player.player._state.status; + return { + code: d.util.setCode(data) + }; + } + }, + // stop + { + name: "$stopPlayer", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player._destroy(); + + return { + code: d.util.setCode(data) + }; + } + }, + // shuffleQueue + { + name: "$shuffleQueue", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + + if (player) player.queue = shuffle(player.queue); + + return { + code: d.util.setCode(data) + }; + } + }, + //unshuffleQueue + { + name: "$unshuffleQueue", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + const player = d.client.voiceManager.players.get(d.guild.id); + if (player) { + player.queue = player.queue.sort((a: { position: number }, b: { position: number }) => a.position - b.position); + } + return { + code: d.util.setCode(data) + }; + } + }, + // songInfo + { + name: "$songInfo", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + const util = require("util"); + const [type = "title", position] = data.inside.splits; + if (!d.client.voiceManager) return d.aoiError.fnError(d, "custom", {}, "Voice Class Is Not Initialised."); + + const player = d.client.voiceManager.players.get(d.guild.id); + if (!player) return d.aoiError.fnError(d, "custom", {}, "Player Not Found."); + if (!player.queue.length) return d.aoiError.fnError(d, "custom", {}, "No Song Is Playing."); + if (!type) return d.aoiError.fnError(d, "custom", {}, "Invalid Type."); + + if (type === "artistURL") { + util.deprecate(() => {}, "artistURL is deprecated. Please use channelUrl instead.")(); + } + + const parsedPos = position ? parseInt(position) : player.currentPosition(); + try { + data.result = eval(`player.queue[${parsedPos}].${type}`); + } catch (error) { + data.result = null; + } + return { + code: d.util.setCode(data) + }; + } + }, + // search + { + name: "$search", + type: "djs", + code: async (d: any) => { + const data = d.util.aoiFunc(d); + let [query, type = "youtube", format = "{title} by {artist} ({duration})", list = 5, separator = "\n"] = data.inside.splits; + + type = type.toLowerCase(); + + if (!["youtube", "spotify", "soundcloud"].includes(type)) return d.aoiError.fnError(d, "custom", {}, "Type Provided"); + + let results: any[] = []; + + if (type === "youtube") { + results = await d.client.voiceManager.search(3, query, list); + } else if (type === "soundcloud") { + results = await d.client.voiceManager.search(0, query, list); + } else if (type === "spotify") { + results = await d.client.voiceManager.search(4, query, list); + } + + const searchResults = results.map((result) => { + let formatResults = format; + + const placeholders = { + "{title}": type === "spotify" ? result.name : result.title, + "{artist}": type === "youtube" ? result.author.name : type === "soundcloud" ? result.publisher_metadata?.artist : type === "spotify" ? result.artists[0].name : "Unknown Artist", + "{duration}": type === "youtube" ? result.duration.seconds * 1000 : type === "soundcloud" ? result.duration : type === "spotify" ? result.duration_ms : 0, + "{digitalFormat}": type === "youtube" ? result.duration.text : type === "soundcloud" ? new Date(result.duration).toISOString().substr(14, 5) : type === "spotify" ? new Date(result.duration_ms).toISOString().substr(14, 5) : "00:00:00", + "{id}": result.id, + "{url}": type === "youtube" ? "https://www.youtube.com/watch?v=" + result.id : type === "soundcloud" ? result.permalink_url : type === "spotify" ? result.external_urls.spotify : undefined + }; + + for (const placeholder in placeholders) { + formatResults = formatResults.replace(new RegExp(placeholder, "g"), placeholders[placeholder]); + } + + return formatResults; + }); + + data.result = searchResults.join(separator); + + return { + code: d.util.setCode(data) + }; + } + } + ); } - ); } - } } diff --git a/src/newstruct/audioPlayer.ts b/src/newstruct/audioPlayer.ts index 72f1815..7dd7aa4 100755 --- a/src/newstruct/audioPlayer.ts +++ b/src/newstruct/audioPlayer.ts @@ -1,809 +1,610 @@ -import { - AudioPlayer as AP, - AudioPlayerStatus, - AudioResource, - createAudioPlayer, - createAudioResource, - entersState, - StreamType, - VoiceConnectionDisconnectReason, - VoiceConnectionStatus, -} from "@discordjs/voice"; -import { - AutoPlay, - LoopMode, - PlatformType, - PlayerEvents, - PluginName, -} from "./../typings/enums"; +import { AudioPlayer as AP, AudioPlayerStatus, AudioResource, createAudioPlayer, createAudioResource, entersState, StreamType, VoiceConnectionDisconnectReason, VoiceConnectionStatus } from "@discordjs/voice"; +import { AutoPlay, LoopMode, PlatformType, PlayerEvents, PluginName } from "./../typings/enums"; import { AudioPlayerMode, AudioPLayerOptions } from "./../typings/interfaces"; -import { - generateScInfo, - requestInfo, - requestStream, -} from "../newutils/request"; -import { - LocalFileTrackInfo, - Plugin, - SoundCloudTrackInfo, - SpotifyTrackInfo, - Track, - UrlTrackInfo, - YoutubeTrackInfo, -} from "../typings/types"; +import { generateScInfo, requestInfo, requestStream } from "../newutils/request"; +import { LocalFileTrackInfo, Plugin, SoundCloudTrackInfo, SpotifyTrackInfo, Track, UrlTrackInfo, YoutubeTrackInfo } from "../typings/types"; import { GuildMember } from "discord.js"; import { setTimeout } from "timers/promises"; import { formattedPlatforms, QueueFormatRegex } from "../newutils/constants"; -import { - shuffle, - YoutubeRelated, - ytRelatedHTMLParser, -} from "../newutils/helpers"; +import { shuffle, YoutubeRelated, ytRelatedHTMLParser } from "../newutils/helpers"; import { Filter } from "./filter"; import { PassThrough, Readable } from "stream"; import { FFmpeg } from "prism-media"; import { fetch } from "undici"; export class AudioPlayer { - options: AudioPLayerOptions; - #modes: AudioPlayerMode; - queue: Track[]; - player: AP; - constructor(options: AudioPLayerOptions) { - this.options = options; - this.#modes = this.defaultMode(); - this.queue = []; - this.player = createAudioPlayer(); - this._configPlayer(); - this.__configConnection(); - } - defaultMode(): AudioPlayerMode { - return { - loop: LoopMode.None, - filterFromStart: false, - shuffled: false, - filtering: false, - paused: false, - volume: 100, - currentTrack: 0, - autoPlay: AutoPlay.None, - filters: [], - ytMix: { - enabled: false, - lastUrl: null, - }, - }; - } - - async play(emit = true) { - let resource: AudioResource; - const current = this.queue[this.#modes.currentTrack]; - if (!current) return; - let stream: Readable | FFmpeg | PassThrough; - //@ts-ignore - stream = await requestStream( - current, - current?.formattedPlatforms ?? "Youtube", - this.options.manager - ); - let s: Readable | FFmpeg; - if (this.options.manager.plugins.has(PluginName.Cacher)) { - const Cacher = >( - this.options.manager.plugins.get(PluginName.Cacher) - ); - await Cacher.write(current, stream); - if (Cacher.type === "disk") stream = Cacher.get(current.id); - } - if ( - this.options.manager.plugins.has(PluginName.Filter) && - this.#modes.filters.length - ) { - const f = this.options.manager.plugins.get(PluginName.Filter); - const ffmpeg = f.createFFmpeg("-af", this.#modes.filters.join(",")); - s = stream.pipe(ffmpeg); - resource = createAudioResource(s, { - inlineVolume: true, - inputType: StreamType.Raw, - }); - } else { - s = stream; - resource = createAudioResource(s, { - inlineVolume: true, - inputType: StreamType.Arbitrary, - }); + options: AudioPLayerOptions; + #modes: AudioPlayerMode; + queue: Track[]; + player: AP; + constructor(options: AudioPLayerOptions) { + this.options = options; + this.#modes = this.defaultMode(); + this.queue = []; + this.player = createAudioPlayer(); + this._configPlayer(); + this.__configConnection(); + } + defaultMode(): AudioPlayerMode { + return { + loop: LoopMode.None, + filterFromStart: false, + shuffled: false, + filtering: false, + paused: false, + volume: 100, + currentTrack: 0, + autoPlay: AutoPlay.None, + filters: [], + ytMix: { + enabled: false, + lastUrl: null + } + }; } - resource.volume.setVolume(this.#modes.volume / 100); - emit && this.options.manager.emit(PlayerEvents.TrackStart, current, this); - this.player.play(resource); - if (this.#modes.ytMix) { - if ( - this.queue[this.#modes.currentTrack].id === this.#modes.ytMix.lastUrl - ) { - const tracks = ( - await this.options.manager.search( - PlatformType.Youtube, - this.queue[this.#modes.currentTrack].id, - 3 - ) - ); - await this.add( - tracks.map((x) => `https://www.youtube.com/watch?v=${x.id}`), - PlatformType.Youtube, - this.queue[this.#modes.currentTrack].requester - ); - } - } - } - async _loopQueue() { - if (this.#modes.currentTrack >= this.queue.length - 1) { - this.#modes.currentTrack = 0; - } else { - this.#modes.currentTrack++; - } - await this.play(); - } - async _playNext() { - const Cacher = >( - this.options.manager.plugins.get(PluginName.Cacher) - ); - if (this.options.type === "default") { - if (this.#modes.currentTrack >= 1) { - const track = this.queue.shift(); - if (this.options.manager.plugins.has(PluginName.Cacher)) { - Cacher.delete(track.id); - } - } else { - this.#modes.currentTrack += 1; + async play(emit = true) { + let resource: AudioResource; + const current = this.queue[this.#modes.currentTrack]; + if (!current) return; + let stream: Readable | FFmpeg | PassThrough; + //@ts-ignore + stream = await requestStream(current, current?.formattedPlatforms ?? "Youtube", this.options.manager); + let s: Readable | FFmpeg; if (this.options.manager.plugins.has(PluginName.Cacher)) { - Cacher.delete(this.queue[this.currentPosition() - 1].id); + const Cacher = >this.options.manager.plugins.get(PluginName.Cacher); + await Cacher.write(current, stream); + if (Cacher.type === "disk") stream = Cacher.get(current.id); } - } - } else if (this.options.type === "fonly") { - const track = this.queue.shift(); - if (this.options.manager.plugins.has(PluginName.Cacher)) { - const Cacher = >( - this.options.manager.plugins.get(PluginName.Cacher) - ); - Cacher.delete(track.id); - } - } else { - this.#modes.currentTrack += 1; - } - await this.play(); - } - _destroy() { - this.#modes = this.defaultMode(); - this.queue = []; - this.player.stop(true); - this.options.manager.players.delete( - this.options.connection.joinConfig.guildId - ); - if (this.options.manager.plugins.has(PluginName.Cacher)) { - const cacher = >( - this.options.manager.plugins.get(PluginName.Cacher) - ); - cacher.clear(); - } - } - _configPlayer(): void { - this.player.on("stateChange", async (os, ns) => { - if ( - os.status !== AudioPlayerStatus.Idle && - ns.status === AudioPlayerStatus.Idle - ) { - if (this.#modes.paused) { - } else if ( - this.#modes.loop === LoopMode.Track && - this.queue[this.#modes.currentTrack] - ) { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; - } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; - } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); - await this.play(); - } - } else if (this.#modes.loop === LoopMode.Queue && this.queue.length) { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; - } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; - } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); - await this._loopQueue(); - } - } else if (this.#modes.autoPlay != "none" && this.queue.length === 1) { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; - } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; - } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); - - await this.autoPlayNext(); - } - } else if ( - this.queue.length > 1 && - this.#modes.currentTrack < this.queue.length - 1 - ) { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; - } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; - } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); - await this._playNext(); - } + if (this.options.manager.plugins.has(PluginName.Filter) && this.#modes.filters.length) { + const f = this.options.manager.plugins.get(PluginName.Filter); + const ffmpeg = f.createFFmpeg("-af", this.#modes.filters.join(",")); + s = stream.pipe(ffmpeg); + resource = createAudioResource(s, { + inlineVolume: true, + inputType: StreamType.Raw + }); } else { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; - } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; - } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); - this.options.manager.emit(PlayerEvents.QueueEnd, this); - // this._destroy(); - // reset queue length instead to trigger queuestart on new tracks? - this.queue.length = 0; - } + s = stream; + resource = createAudioResource(s, { + inlineVolume: true, + inputType: StreamType.Arbitrary + }); } - } - if ( - os.status === AudioPlayerStatus.Playing && - ns.status !== AudioPlayerStatus.Playing && - ns.status !== AudioPlayerStatus.Idle && - ns.status !== AudioPlayerStatus.Paused - ) { - if (this.#modes.seeked) { - this.#modes.seeked = false; - return; + + resource.volume.setVolume(this.#modes.volume / 100); + emit && this.options.manager.emit(PlayerEvents.TrackStart, current, this); + this.player.play(resource); + if (this.#modes.ytMix) { + if (this.queue[this.#modes.currentTrack].id === this.#modes.ytMix.lastUrl) { + const tracks = await this.options.manager.search(PlatformType.Youtube, this.queue[this.#modes.currentTrack].id, 3); + await this.add( + tracks.map((x) => `https://www.youtube.com/watch?v=${x.id}`), + PlatformType.Youtube, + this.queue[this.#modes.currentTrack].requester + ); + } } - if (this.#modes.filtering) { - this.#modes.filtering = false; - return; + } + async _loopQueue() { + if (this.#modes.currentTrack >= this.queue.length - 1) { + this.#modes.currentTrack = 0; } else { - this.options.manager.emit( - PlayerEvents.TrackEnd, - this.queue[this.#modes.currentTrack], - this - ); + this.#modes.currentTrack++; } - } - }); - this.player.on("error", async (error: any) => { - this.options.manager.emit(PlayerEvents.AudioError, error, this); - }); - - if (this.options.manager.configs?.devOptions?.debug) { - this.player.on("debug", (msg) => - this.options.manager.configs?.devOptions?.debug - ? console.log(msg) - : undefined - ); + await this.play(); } - - this.options.connection.subscribe(this.player); - } - async add(track: string[], type: PlatformType, member: GuildMember) { - for (let i = 0; i < track.length; i++) { - if (type === PlatformType.Youtube) { - const id = track[i].split("?v=")[1].split("&")[0]; - if ( - track[i].includes("&list=") && - track[i].includes("&index=") && - track.includes("watch?v=") && - !this.#modes.ytMix.enabled - ) { - this.#modes.ytMix.enabled = true; - this.#modes.ytMix.lastUrl = track[track.length - 1]; + async _playNext() { + const Cacher = >this.options.manager.plugins.get(PluginName.Cacher); + if (this.options.type === "default") { + if (this.#modes.currentTrack >= 1) { + const track = this.queue.shift(); + if (this.options.manager.plugins.has(PluginName.Cacher)) { + Cacher.delete(track.id); + } + } else { + this.#modes.currentTrack += 1; + if (this.options.manager.plugins.has(PluginName.Cacher)) { + Cacher.delete(this.queue[this.currentPosition() - 1].id); + } + } + } else if (this.options.type === "fonly") { + const track = this.queue.shift(); + if (this.options.manager.plugins.has(PluginName.Cacher)) { + const Cacher = >this.options.manager.plugins.get(PluginName.Cacher); + Cacher.delete(track.id); + } + } else { + this.#modes.currentTrack += 1; } - const info = await requestInfo(id, "Youtube", this.options.manager); - if (!info) continue; - this.queue.push({ - ...(info), - requester: member, - position: this.queue.length, - }); - this.options.manager.emit( - PlayerEvents.TrackAdd, - info, - this - ); - if (this.queue.length === 1) { - this.options.manager.emit(PlayerEvents.QueueStart, track, this); - await this.play(); + await this.play(); + } + _destroy() { + this.#modes = this.defaultMode(); + this.queue = []; + this.player.stop(true); + this.options.manager.players.delete(this.options.connection.joinConfig.guildId); + if (this.options.manager.plugins.has(PluginName.Cacher)) { + const cacher = >this.options.manager.plugins.get(PluginName.Cacher); + cacher.clear(); } - } else if (type === PlatformType.SoundCloud) { - const info = await requestInfo( - track[i], - formattedPlatforms[PlatformType.SoundCloud], - this.options.manager - ); + } + _configPlayer(): void { + this.player.on("stateChange", async (os, ns) => { + if (os.status !== AudioPlayerStatus.Idle && ns.status === AudioPlayerStatus.Idle) { + if (this.#modes.paused) { + } else if (this.#modes.loop === LoopMode.Track && this.queue[this.#modes.currentTrack]) { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); + await this.play(); + } + } else if (this.#modes.loop === LoopMode.Queue && this.queue.length) { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); + await this._loopQueue(); + } + } else if (this.#modes.autoPlay != "none" && this.queue.length === 1) { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); - if (!info) continue; - for (let i = 0; i < (info).length; i++) { - this.queue.push({ - ...(info[i]), - requester: member, - position: this.queue.length, - }); - this.options.manager.emit( - PlayerEvents.TrackAdd, - info, - this - ); - if (this.queue.length === 1) { - this.options.manager.emit(PlayerEvents.QueueStart, track, this); - await this.play(); - } - } - } else if (type === PlatformType.LocalFile) { - const info = await requestInfo( - track[i], - "LocalFile", - this.options.manager - ); - if (!info) continue; - this.queue.push({ - ...(info), - requester: member, - position: this.queue.length, + await this.autoPlayNext(); + } + } else if (this.queue.length > 1 && this.#modes.currentTrack < this.queue.length - 1) { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); + await this._playNext(); + } + } else { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); + this.options.manager.emit(PlayerEvents.QueueEnd, this); + // this._destroy(); + // reset queue length instead to trigger queuestart on new tracks? + this.queue.length = 0; + } + } + } + if (os.status === AudioPlayerStatus.Playing && ns.status !== AudioPlayerStatus.Playing && ns.status !== AudioPlayerStatus.Idle && ns.status !== AudioPlayerStatus.Paused) { + if (this.#modes.seeked) { + this.#modes.seeked = false; + return; + } + if (this.#modes.filtering) { + this.#modes.filtering = false; + return; + } else { + this.options.manager.emit(PlayerEvents.TrackEnd, this.queue[this.#modes.currentTrack], this); + } + } }); - this.options.manager.emit( - PlayerEvents.TrackAdd, - info, - this - ); - if (this.queue.length === 1) { - this.options.manager.emit(PlayerEvents.QueueStart, track, this); - await this.play(); - } - } else if (type === PlatformType.Spotify) { - let info = ( - (( - await requestInfo(track[i], "Spotify", this.options.manager) - )) - ); - if (!info) continue; - if (!Array.isArray(info)) info = [info]; - for (let i = 0; i < info.length; i++) { - const moreinfo = await this.options.manager.platforms.spotify.getData( - info[i].url - ); - this.queue.push({ - ...info[i], - requester: member, - position: this.queue.length, - thumbnail: moreinfo.coverArt.sources[0].url, - createdAt: new Date(moreinfo.releaseDate.isoString) ?? null, - }); - this.options.manager.emit( - PlayerEvents.TrackAdd, - (info), - this - ); - if (this.queue.length === 1) { - this.options.manager.emit(PlayerEvents.QueueStart, track, this); - await this.play(); - } - } - } else if (type === PlatformType.Url) { - const info = await requestInfo( - track[i], - formattedPlatforms[PlatformType.Url], - this.options.manager - ); - this.queue.push({ - ...(info), - requester: member, - position: this.queue.length, + this.player.on("error", async (error: any) => { + console.log(error); + this.options.manager.emit(PlayerEvents.AudioError, error, this); }); - this.options.manager.emit( - PlayerEvents.TrackAdd, - info, - this - ); - if (this.queue.length === 1) { - this.options.manager.emit(PlayerEvents.QueueStart, track, this); - await this.play(); - } - } - if (this.options.manager.configs.requestOptions?.offsetTimeout) { - await setTimeout( - this.options.manager.configs.requestOptions?.offsetTimeout - ); - } - } - } - removeTrack(position: number) { - if (position > this.queue.length) return; - this.queue.splice(position, 1); - } - skip() { - return this.player.stop(); - } - skipTo(position: number) { - if (position > this.queue.length) return; - this.#modes.currentTrack = position - 1; - if (this.options.type === "default") { - for (let i = 0; i < position - 1; i++) { - if (this.loop === LoopMode.Queue) { - this.queue.push(this.queue.shift()); - } else { - this.queue.shift(); + if (this.options.manager.configs?.devOptions?.debug) { + this.player.on("debug", (msg) => (this.options.manager.configs?.devOptions?.debug ? console.log(msg) : undefined)); } - } - } else if (this.options.type === "bidirect") { - } else if (this.options.type === "fonly") { - for (let i = 0; i < position - 1; i++) { - if (this.loop === LoopMode.Queue) { - this.queue.push(this.queue.shift()); - } else { - this.queue.shift(); + + this.options.connection.subscribe(this.player); + } + async add(track: string[], type: PlatformType, member: GuildMember) { + for (let i = 0; i < track.length; i++) { + if (type === PlatformType.Youtube) { + const id = track[i].split("?v=")[1].split("&")[0]; + if (track[i].includes("&list=") && track[i].includes("&index=") && track.includes("watch?v=") && !this.#modes.ytMix.enabled) { + this.#modes.ytMix.enabled = true; + this.#modes.ytMix.lastUrl = track[track.length - 1]; + } + const info = await requestInfo(id, "Youtube", this.options.manager); + if (!info) continue; + this.queue.push({ + ...(info), + requester: member, + position: this.queue.length + }); + this.options.manager.emit(PlayerEvents.TrackAdd, info, this); + if (this.queue.length === 1) { + this.options.manager.emit(PlayerEvents.QueueStart, track, this); + await this.play(); + } + } else if (type === PlatformType.SoundCloud) { + const info = await requestInfo(track[i], formattedPlatforms[PlatformType.SoundCloud], this.options.manager); + + if (!info) continue; + for (let i = 0; i < (info).length; i++) { + this.queue.push({ + ...(info[i]), + requester: member, + position: this.queue.length + }); + this.options.manager.emit(PlayerEvents.TrackAdd, info, this); + if (this.queue.length === 1) { + this.options.manager.emit(PlayerEvents.QueueStart, track, this); + await this.play(); + } + } + } else if (type === PlatformType.LocalFile) { + const info = await requestInfo(track[i], "LocalFile", this.options.manager); + if (!info) continue; + this.queue.push({ + ...(info), + requester: member, + position: this.queue.length + }); + this.options.manager.emit(PlayerEvents.TrackAdd, info, this); + if (this.queue.length === 1) { + this.options.manager.emit(PlayerEvents.QueueStart, track, this); + await this.play(); + } + } else if (type === PlatformType.Spotify) { + let info = (await requestInfo(track[i], "Spotify", this.options.manager)); + if (!info) continue; + if (!Array.isArray(info)) info = [info]; + for (let i = 0; i < info.length; i++) { + const moreinfo = await this.options.manager.platforms.spotify.getData(info[i].url); + this.queue.push({ + ...info[i], + requester: member, + position: this.queue.length, + thumbnail: moreinfo.coverArt ? moreinfo.coverArt.sources[0].url : null, + createdAt: new Date(moreinfo.releaseDate.isoString) ?? null + }); + this.options.manager.emit(PlayerEvents.TrackAdd, (info), this); + if (this.queue.length === 1) { + this.options.manager.emit(PlayerEvents.QueueStart, track, this); + await this.play(); + } + } + } else if (type === PlatformType.Url) { + const info = await requestInfo(track[i], formattedPlatforms[PlatformType.Url], this.options.manager); + this.queue.push({ + ...(info), + requester: member, + position: this.queue.length + }); + this.options.manager.emit(PlayerEvents.TrackAdd, info, this); + if (this.queue.length === 1) { + this.options.manager.emit(PlayerEvents.QueueStart, track, this); + await this.play(); + } + } + + if (this.options.manager.configs.requestOptions?.offsetTimeout) { + await setTimeout(this.options.manager.configs.requestOptions?.offsetTimeout); + } } - } + } + removeTrack(position: number) { + if (position > this.queue.length) return; + this.queue.splice(position, 1); + } + skip() { + return this.player.stop(); + } + skipTo(position: number) { + if (position > this.queue.length) return; + this.#modes.currentTrack = position - 1; + if (this.options.type === "default") { + for (let i = 0; i < position - 1; i++) { + if (this.loop === LoopMode.Queue) { + this.queue.push(this.queue.shift()); + } else { + this.queue.shift(); + } + } + } else if (this.options.type === "bidirect") { + } else if (this.options.type === "fonly") { + for (let i = 0; i < position - 1; i++) { + if (this.loop === LoopMode.Queue) { + this.queue.push(this.queue.shift()); + } else { + this.queue.shift(); + } + } - this.#modes.currentTrack = 0; - } - this.skip(); - } - pause() { - this.options.manager.emit(PlayerEvents.TrackPause, this); - return (this.#modes.paused = this.player.pause()); - } - resume() { - this.options.manager.emit(PlayerEvents.TrackResume, this); - this.#modes.paused = false; - return this.player.unpause(); - } - set volume(volume: number) { - this.#modes.volume = volume; - //@ts-ignore - this.player.state.resource.volume.setVolume(volume / 100); - } - get volume() { - return this.#modes.volume; - } - set loop(loop: LoopMode) { - this.#modes.loop = loop; - } - get loop() { - return this.#modes.loop; - } - set autoPlay(autoPlay: AutoPlay) { - this.#modes.autoPlay = autoPlay; - } - get autoPlay() { - return this.#modes.autoPlay; - } - shuffle() { - this.queue = shuffle(this.queue); - this.#modes.shuffled = true; - } - unshuffle() { - this.queue = this.queue.sort((a, b) => a.position - b.position); - this.#modes.shuffled = false; - } - isShuffled() { - return this.#modes.shuffled; - } - isPaused() { - return this.#modes.paused; - } - isLoopEnabled() { - return this.#modes.loop !== LoopMode.None; - } - isAutoPlayEnabled() { - return this.#modes.autoPlay !== AutoPlay.None; - } - currentPosition() { - return this.#modes.currentTrack; - } - getTrackCurrentDuration() { - //@ts-ignore - return this.player.state.resource?.playbackDuration ?? 0; - } - get currentTrack() { - return this.queue[this.#modes.currentTrack]; - } - get previousTrack() { - return this.queue[this.#modes.currentTrack - 1]; - } - updateFilters(filterArr: string[]) { - this.#modes.filters.push(...filterArr); - } - async playPrevious() { - if (this.#modes.currentTrack <= 0) return; - this.#modes.currentTrack--; - await this.play(); - } - setFilters(filterArr: string[]) { - this.#modes.filters = filterArr; - } - removeFilters() { - this.#modes.filters = []; - } - get filters() { - return [...this.#modes.filters]; - } - get seek() { - return this.#modes.seeked; - } - seeked(seek: boolean) { - this.#modes.seeked = seek; - } - setFiltering(type: boolean) { - this.#modes.filtering = type; - } - async autoPlayNext() { - if ( - this.autoPlay === - AutoPlay.Youtube || this.autoPlay === AutoPlay.Spotify - ) { - const parsed = await ( - await fetch(`https://youtube.com/watch?v=${this.currentTrack.id}`) - ).text(); - const data = ytRelatedHTMLParser(parsed); - const ids = YoutubeRelated(data); - for (const id of ids) { - const info = await requestInfo( - id, - this.autoPlay === "youtube" ? "Youtube" : "Spotify", - this.options.manager - ); - if (!info) { - continue; + this.#modes.currentTrack = 0; } - this.queue.push({ - ...(info), - requester: this.currentTrack.requester, - position: this.queue.length, - }); - } - } else if (this.autoPlay === AutoPlay.SoundCloud) { - const sc = this.options.manager.platforms.soundcloud; - //@ts-ignore - const { collection: data } = await sc.related( + this.skip(); + } + pause() { + this.options.manager.emit(PlayerEvents.TrackPause, this); + return (this.#modes.paused = this.player.pause()); + } + resume() { + this.options.manager.emit(PlayerEvents.TrackResume, this); + this.#modes.paused = false; + return this.player.unpause(); + } + set volume(volume: number) { + this.#modes.volume = volume; //@ts-ignore - this.currentTrack.scid, - 10 - ); - for (const track of data) { - const info = generateScInfo(track); - if (!info) continue; - this.queue.push({ - ...(info), - requester: this.currentTrack.requester, - position: this.queue.length, - }); - } - } else if (this.autoPlay === AutoPlay.Relative) { - if ( - this.currentTrack.formattedPlatforms.toLowerCase() === - AutoPlay.Youtube /*|| this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.Spotify*/ - ) { - const parsed = await ( - await fetch(`https://youtube.com/watch?v=${this.currentTrack.id}`) - ).text(); - const data = ytRelatedHTMLParser(parsed); - const ids = YoutubeRelated(data); - for (const id of ids) { - const info = await requestInfo( - id, - this.currentTrack.formattedPlatforms.toLowerCase() === "youtube" - ? "Youtube" - : "Spotify", - this.options.manager - ); - if (!info) continue; - this.queue.push({ - ...(info), - requester: this.currentTrack.requester, - position: this.queue.length, - }); - } - } else if ( - this.currentTrack.formattedPlatforms.toLowerCase() === - AutoPlay.SoundCloud - ) { - const sc = this.options.manager.platforms.soundcloud; + this.player.state.resource.volume.setVolume(volume / 100); + } + get volume() { + return this.#modes.volume; + } + set loop(loop: LoopMode) { + this.#modes.loop = loop; + } + get loop() { + return this.#modes.loop; + } + set autoPlay(autoPlay: AutoPlay) { + this.#modes.autoPlay = autoPlay; + } + get autoPlay() { + return this.#modes.autoPlay; + } + shuffle() { + this.queue = shuffle(this.queue); + this.#modes.shuffled = true; + } + unshuffle() { + this.queue = this.queue.sort((a, b) => a.position - b.position); + this.#modes.shuffled = false; + } + isShuffled() { + return this.#modes.shuffled; + } + isPaused() { + return this.#modes.paused; + } + isLoopEnabled() { + return this.#modes.loop !== LoopMode.None; + } + isAutoPlayEnabled() { + return this.#modes.autoPlay !== AutoPlay.None; + } + currentPosition() { + return this.#modes.currentTrack; + } + getTrackCurrentDuration() { //@ts-ignore - const { collection: data } = await sc.related( - //@ts-ignore - this.currentTrack.scid, - 10 - ); - for (const track of data) { - const info = generateScInfo(track); - if (!info) continue; - this.queue.push({ - ...(info), - requester: this.currentTrack.requester, - position: this.queue.length, - }); - } - } + return this.player.state.resource?.playbackDuration ?? 0; } - - await this._playNext(); - } - __configConnection() { - this.options.connection.on( - "stateChange", - async ( - _: any, - newState: { status: any; reason: any; closeCode: number } - ) => { - if (newState.status === VoiceConnectionStatus.Disconnected) { - if ( - newState.reason === - VoiceConnectionDisconnectReason.WebSocketClose && - newState.closeCode === 4014 - ) { - try { - await entersState( - this.options.connection, - VoiceConnectionStatus.Connecting, - 5_000 - ); - // Probably moved voice channel - } catch { - this.options.connection.destroy(); - this._destroy(); - // Probably removed from voice channel + get currentTrack() { + return this.queue[this.#modes.currentTrack]; + } + get previousTrack() { + return this.queue[this.#modes.currentTrack - 1]; + } + updateFilters(filterArr: string[]) { + this.#modes.filters.push(...filterArr); + } + async playPrevious() { + if (this.#modes.currentTrack <= 0) return; + this.#modes.currentTrack--; + await this.play(); + } + setFilters(filterArr: string[]) { + this.#modes.filters = filterArr; + } + removeFilters() { + this.#modes.filters = []; + } + get filters() { + return [...this.#modes.filters]; + } + get seek() { + return this.#modes.seeked; + } + seeked(seek: boolean) { + this.#modes.seeked = seek; + } + setFiltering(type: boolean) { + this.#modes.filtering = type; + } + async autoPlayNext() { + if (this.autoPlay === AutoPlay.Youtube || this.autoPlay === AutoPlay.Spotify) { + const parsed = await (await fetch(`https://youtube.com/watch?v=${this.currentTrack.id}`)).text(); + const data = ytRelatedHTMLParser(parsed); + const ids = YoutubeRelated(data); + for (const id of ids) { + const info = await requestInfo(id, this.autoPlay === "youtube" ? "Youtube" : "Spotify", this.options.manager); + if (!info) { + continue; + } + this.queue.push({ + ...(info), + requester: this.currentTrack.requester, + position: this.queue.length + }); } - } else if (this.options.connection.rejoinAttempts < 5) { - /** - * The disconnect in this case is recoverable, and we also have <5 repeated attempts so we will reconnect. - */ - await setTimeout( - (this.options.connection.rejoinAttempts + 1) * 5_000 - ); - this.options.connection.rejoin(); - } else { - /** - * The disconnect in this case may be recoverable, but we have no more remaining attempts - destroy. - */ - this._destroy(); - this.options.connection.destroy(); - } - } else if (newState.status === VoiceConnectionStatus.Destroyed) { - /** - * Once destroyed, stop the subscription. - */ - this._destroy(); - this.player.stop(true); - } else if ( - newState.status === VoiceConnectionStatus.Connecting || - newState.status === VoiceConnectionStatus.Signalling - ) { - /** - * In the Signalling or Connecting states, we set a 20 second time limit for the connection to become ready - * before destroying the voice connection. This stops the voice connection permanently existing in one of these - * states. - */ - - try { - await entersState( - this.options.connection, - VoiceConnectionStatus.Ready, - 20_000 + } else if (this.autoPlay === AutoPlay.SoundCloud) { + const sc = this.options.manager.platforms.soundcloud; + //@ts-ignore + const { collection: data } = await sc.related( + //@ts-ignore + this.currentTrack.scid, + 10 ); - } catch { - if ( - this.options.connection.state.status !== - VoiceConnectionStatus.Destroyed - ) { - this._destroy(); - this.options.connection.destroy(); + for (const track of data) { + const info = generateScInfo(track); + if (!info) continue; + this.queue.push({ + ...(info), + requester: this.currentTrack.requester, + position: this.queue.length + }); + } + } else if (this.autoPlay === AutoPlay.Relative) { + if (this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.Youtube /*|| this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.Spotify*/) { + const parsed = await (await fetch(`https://youtube.com/watch?v=${this.currentTrack.id}`)).text(); + const data = ytRelatedHTMLParser(parsed); + const ids = YoutubeRelated(data); + for (const id of ids) { + const info = await requestInfo(id, this.currentTrack.formattedPlatforms.toLowerCase() === "youtube" ? "Youtube" : "Spotify", this.options.manager); + if (!info) continue; + this.queue.push({ + ...(info), + requester: this.currentTrack.requester, + position: this.queue.length + }); + } + } else if (this.currentTrack.formattedPlatforms.toLowerCase() === AutoPlay.SoundCloud) { + const sc = this.options.manager.platforms.soundcloud; + //@ts-ignore + const { collection: data } = await sc.related( + //@ts-ignore + this.currentTrack.scid, + 10 + ); + for (const track of data) { + const info = generateScInfo(track); + if (!info) continue; + this.queue.push({ + ...(info), + requester: this.currentTrack.requester, + position: this.queue.length + }); + } } - } } - } - ); - } - getQueue( - page = 1, - limit = 10, - format = "{position}) {title} | {requester.user.username}" - ) { - let start = (page - 1) * limit; - let end = page * limit; - //start queue from current track and if it is loop queue then push all prev tracks to end of queue - const prevTracks = this.queue.slice(0, this.currentPosition()); - const nextTracks = this.queue.slice(this.currentPosition()); - let tracks = - this.loop === LoopMode.Queue - ? [...nextTracks, ...prevTracks] - : nextTracks; - //add prev tracks behind 0 index with limited length - let index = prevTracks.length - 1; - let ng = []; - if (this.loop !== LoopMode.Queue) - for (let i = 0; i < prevTracks.length; i++) { - ng[index--] = prevTracks[i]; - } - if (page < 0) { - end = prevTracks.length - Math.abs(Number(page)) * limit; - start = prevTracks.length - Math.abs(Number(page) + 1) * limit; - // get the -ve index tracks - const res = []; - for (let i = end; i < start; i++) { - res.push(ng[i]); - } - end = -res.length; - tracks = res; - } else { - tracks = tracks.slice(start, end); + + await this._playNext(); } + __configConnection() { + this.options.connection.on("stateChange", async (_: any, newState: { status: any; reason: any; closeCode: number }) => { + if (newState.status === VoiceConnectionStatus.Disconnected) { + if (newState.reason === VoiceConnectionDisconnectReason.WebSocketClose && newState.closeCode === 4014) { + try { + await entersState(this.options.connection, VoiceConnectionStatus.Connecting, 5_000); + // Probably moved voice channel + } catch { + this.options.connection.destroy(); + this._destroy(); + // Probably removed from voice channel + } + } else if (this.options.connection.rejoinAttempts < 5) { + /** + * The disconnect in this case is recoverable, and we also have <5 repeated attempts so we will reconnect. + */ + await setTimeout((this.options.connection.rejoinAttempts + 1) * 5_000); + this.options.connection.rejoin(); + } else { + /** + * The disconnect in this case may be recoverable, but we have no more remaining attempts - destroy. + */ + this._destroy(); + this.options.connection.destroy(); + } + } else if (newState.status === VoiceConnectionStatus.Destroyed) { + /** + * Once destroyed, stop the subscription. + */ + this._destroy(); + this.player.stop(true); + } else if (newState.status === VoiceConnectionStatus.Connecting || newState.status === VoiceConnectionStatus.Signalling) { + /** + * In the Signalling or Connecting states, we set a 20 second time limit for the connection to become ready + * before destroying the voice connection. This stops the voice connection permanently existing in one of these + * states. + */ - const props = format.match(QueueFormatRegex); - if (!props) return []; - if (page < 0) { - start = (Number(page) + 1) * limit - 1; - } - const queue = tracks.map((track, index) => { - let formatted = format; - props.forEach((prop) => { - const propValue = prop.replace("{", "").replace("}", ""); - let value; - if (propValue === "position") { - value = page < 0 ? end + index : start + index; - } else if (propValue === "digitalFormat") { - const duration = eval(`track?.duration`); - value = new Date(duration).toISOString().substr(14, 5); + try { + await entersState(this.options.connection, VoiceConnectionStatus.Ready, 20_000); + } catch { + if (this.options.connection.state.status !== VoiceConnectionStatus.Destroyed) { + this._destroy(); + this.options.connection.destroy(); + } + } + } + }); + } + getQueue(page = 1, limit = 10, format = "{position}) {title} | {requester.user.username}") { + let start = (page - 1) * limit; + let end = page * limit; + //start queue from current track and if it is loop queue then push all prev tracks to end of queue + const prevTracks = this.queue.slice(0, this.currentPosition()); + const nextTracks = this.queue.slice(this.currentPosition()); + let tracks = this.loop === LoopMode.Queue ? [...nextTracks, ...prevTracks] : nextTracks; + //add prev tracks behind 0 index with limited length + let index = prevTracks.length - 1; + let ng = []; + if (this.loop !== LoopMode.Queue) + for (let i = 0; i < prevTracks.length; i++) { + ng[index--] = prevTracks[i]; + } + if (page < 0) { + end = prevTracks.length - Math.abs(Number(page)) * limit; + start = prevTracks.length - Math.abs(Number(page) + 1) * limit; + // get the -ve index tracks + const res = []; + for (let i = end; i < start; i++) { + res.push(ng[i]); + } + end = -res.length; + tracks = res; } else { - value = eval(`track?.${propValue}`); + tracks = tracks.slice(start, end); } - formatted = formatted.replaceAll(prop, value); - }); - return formatted; - }); - return queue; - } - getPing(type: "ws" | "udp" = "ws") { - return this.options.connection.ping[type]; - } - stop() { - this.queue = []; - this.defaultMode(); - this.player.stop(); - } + + const props = format.match(QueueFormatRegex); + if (!props) return []; + if (page < 0) { + start = (Number(page) + 1) * limit - 1; + } + const queue = tracks.map((track, index) => { + let formatted = format; + props.forEach((prop) => { + const propValue = prop.replace("{", "").replace("}", ""); + let value; + if (propValue === "position") { + value = page < 0 ? end + index : start + index; + } else if (propValue === "digitalFormat") { + const duration = eval(`track?.duration`); + value = new Date(duration).toISOString().substr(14, 5); + } else { + value = eval(`track?.${propValue}`); + } + formatted = formatted.replaceAll(prop, value); + }); + return formatted; + }); + return queue; + } + getPing(type: "ws" | "udp" = "ws") { + return this.options.connection.ping[type]; + } + stop() { + this.queue.length = 0; + this.defaultMode(); + this.player.stop(); + } } diff --git a/src/newstruct/cacher.ts b/src/newstruct/cacher.ts index 421ef5a..b27383b 100755 --- a/src/newstruct/cacher.ts +++ b/src/newstruct/cacher.ts @@ -1,13 +1,5 @@ import { unlink, writeFile } from "fs/promises"; -import { - createReadStream, - createWriteStream, - existsSync, - mkdirSync, - PathLike, - readdirSync, - unlinkSync, -} from "fs"; +import { createReadStream, createWriteStream, existsSync, mkdirSync, PathLike, readdirSync, unlinkSync } from "fs"; import { join } from "path"; import { pipeline } from "stream/promises"; import { createGzip, createUnzip } from "zlib"; @@ -17,133 +9,119 @@ import { Track } from "../typings/types"; import { PlatformType } from "../typings/enums"; import hidefile from "hidefile"; export class Cacher { - #type: T; - #map: Map = - new Map(); - #limit: number | null; - #path: string | null; - #prefixedPath: string; - constructor({ type }: { type: T }) { - this.#type = type; - this.#path = "MUSIC_CACHE"; - this.#prefixedPath = ".MUSIC_CACHE"; + #type: T; + #map: Map = new Map(); + #limit: number | null; + #path: string | null; + #prefixedPath: string; + constructor({ type }: { type: T }) { + this.#type = type; + this.#path = "MUSIC_CACHE"; + this.#prefixedPath = ".MUSIC_CACHE"; - if ( - this.#type === "disk" && - !existsSync(this.#path) && - !existsSync(this.#prefixedPath) - ) { - mkdirSync(this.#path, { - recursive: true, - }); - hidefile.isHidden(this.#path, (err: Error | null, hidden: boolean) => { - if (err === null) { - if (!hidden) { - this.#path = hidefile.hideSync(this.#path).toString(); - } + if (this.#type === "disk" && !existsSync(this.#path) && !existsSync(this.#prefixedPath)) { + mkdirSync(this.#path, { + recursive: true + }); + hidefile.isHidden(this.#path, (err: Error | null, hidden: boolean) => { + if (err === null) { + if (!hidden) { + this.#path = hidefile.hideSync(this.#path).toString(); + } + } + }); + } + if (this.#path !== this.#prefixedPath) { + this.#path = this.#prefixedPath; + } + if (this.#type === "disk" && existsSync(this.#path)) { + const files = readdirSync(this.#path); + if (files.length > 0) { + for (const file of files) { + unlinkSync(join(this.#path, file)); + } + } + } + } + async #doCompressionSave(stream: NodeJS.ReadableStream, hash: string) { + const gzip = createGzip(); + await writeFile(hash, ""); + const file = createWriteStream(hash); + await pipeline(stream, gzip, file); + } + async write(metaData: Track<"SoundCloud" | "Youtube" | "LocalFile" | "Spotify" | "Url">, stream: Readable) { + if (this.has(metaData.id)) return; + if (metaData.platformType === PlatformType.LocalFile) { + this.#map.set(metaData.id, (>metaData).url); + } else if (this.type === "memory") { + const data = []; + if (stream instanceof ReadableStream) { + stream = Readable.from(stream); + } + stream.on("data", (chunk) => { + data.push(chunk); + }); + stream.on("end", () => { + //@ts-ignore + this.#map.set(metaData.id, data); + }); + } else if (this.#type === "disk") { + const hash = join(this.#path, `${metaData.id.replaceAll("/", "").replaceAll(":", "").replaceAll(".", "")}.gz`); + if (stream instanceof ReadableStream) { + stream = Readable.from(stream); + } + await this.#doCompressionSave(stream, hash); + this.#map.set(metaData.id, hash); + } + } + get(id: string) { + if (this.#type === "memory") { + const a = this.#map.get(id); + if (Array.isArray(a)) return Readable.from(a); + else { + return createReadStream(a); + } + } else { + const hash = this.#map.get(id); + if (hash) { + if (!hash.endsWith(".gz")) return createReadStream(hash); + const file = createReadStream(hash); + const unzip = createUnzip(); + const stream = file.pipe(unzip); + return Readable.from(stream); + } } - }); } - if (this.#path !== this.#prefixedPath) { - this.#path = this.#prefixedPath; + delete(id: string) { + if (this.#type === "memory") { + this.#map.delete(id); + } else { + const hash = this.#map.get(id); + if (hash) { + this.#map.delete(id); + unlinkSync(hash); + } + } } - if (this.#type === "disk" && existsSync(this.#path)) { - const files = readdirSync(this.#path); - if (files.length > 0) { - for (const file of files) { - unlinkSync(join(this.#path, file)); + clear() { + if (this.#type === "disk") { + const files = readdirSync(this.#path); + for (const file of files) { + unlink(join(this.#path, file)); + } } - } + this.#map.clear(); } - } - async #doCompressionSave(stream: NodeJS.ReadableStream, hash: string) { - const gzip = createGzip(); - await writeFile(hash, ""); - const file = createWriteStream(hash); - await pipeline(stream, gzip, file); - } - async write( - metaData: Track<"SoundCloud" | "Youtube" | "LocalFile" | "Spotify" | "Url">, - stream: Readable - ) { - if (this.has(metaData.id)) return; - if (metaData.platformType === PlatformType.LocalFile) { - this.#map.set(metaData.id, (>metaData).url); - } else if (this.type === "memory") { - const data = []; - if (stream instanceof ReadableStream) { - stream = Readable.from(stream); - } - stream.on("data", (chunk) => { - data.push(chunk); - }); - stream.on("end", () => { - //@ts-ignore - this.#map.set(metaData.id, data); - }); - } else if (this.#type === "disk") { - const hash = join( - this.#path, - `${metaData.id - .replaceAll("/", "") - .replaceAll(":", "") - .replaceAll(".", "")}.gz` - ); - if (stream instanceof ReadableStream) { - stream = Readable.from(stream); - } - await this.#doCompressionSave(stream, hash); - this.#map.set(metaData.id, hash); + has(id: string) { + return this.#map.has(id); } - } - get(id: string) { - if (this.#type === "memory") { - const a = this.#map.get(id); - if (Array.isArray(a)) return Readable.from(a); - else { - return createReadStream(a); - } - } else { - const hash = this.#map.get(id); - if (hash) { - if (!hash.endsWith(".gz")) return createReadStream(hash); - const file = createReadStream(hash); - const unzip = createUnzip(); - const stream = file.pipe(unzip); - return Readable.from(stream); - } + get map() { + return this.#map; } - } - delete(id: string) { - if (this.#type === "memory") { - this.#map.delete(id); - } else { - const hash = this.#map.get(id); - if (hash) { - this.#map.delete(id); - unlinkSync(hash); - } + get type() { + return this.#type; } - } - clear() { - if (this.#type === "disk") { - const files = readdirSync(this.#path); - for (const file of files) { - unlink(join(this.#path, file)); - } + get path() { + return this.#path ?? null; } - this.#map.clear(); - } - has(id: string) { - return this.#map.has(id); - } - get map() { - return this.#map; - } - get type() { - return this.#type; - } - get path() { - return this.#path ?? null; - } } diff --git a/src/newstruct/manager.ts b/src/newstruct/manager.ts index f0d0871..ea0d1db 100755 --- a/src/newstruct/manager.ts +++ b/src/newstruct/manager.ts @@ -1,21 +1,11 @@ import sui, { Spotify } from "spotify-url-info"; import SpotifyWebApi from "spotify-web-api-node"; -import { - DiscordGatewayAdapterCreator, - entersState, - joinVoiceChannel, - VoiceConnectionStatus, -} from "@discordjs/voice"; +import { DiscordGatewayAdapterCreator, entersState, joinVoiceChannel, VoiceConnectionStatus } from "@discordjs/voice"; import { Snowflake, VoiceBasedChannel } from "discord.js"; import { TypedEmitter } from "tiny-typed-emitter/lib/index"; import { Innertube, UniversalCache, Log } from "youtubei.js"; import IT from "youtubei.js"; -import { - Credentials, - AudioPLayerOptions, - ManagerConfigurations, - ManagerEvents, -} from "../typings/interfaces"; +import { Credentials, AudioPLayerOptions, ManagerConfigurations, ManagerEvents } from "../typings/interfaces"; import { AudioPlayer } from "./audioPlayer"; import scdl from "soundcloud-downloader"; import { SCDL } from "soundcloud-downloader/src"; @@ -24,406 +14,356 @@ import { PlatformType, PluginName } from "../typings/enums"; import { TrackInfo } from "soundcloud-downloader/src/info"; import { Plugin } from "../typings/types"; import { JSDOM } from "jsdom"; -import { BG } from "bgutils-js"; +import { BG, BgConfig } from "bgutils-js"; import { existsSync, readFileSync, writeFileSync } from "fs"; import { join } from "path"; export class Manager extends TypedEmitter { - configs: ManagerConfigurations; - players: Map; - platforms: { youtube: Promise; spotify?: Spotify; soundcloud: SCDL }; - plugins: Map> = new Map< - PluginName, - Plugin - >(); - spotifyApi: SpotifyWebApi; - - constructor(config?: ManagerConfigurations) { - super(); - this.#validateConfig(config); - this.configs = config ?? Manager.defaultConfig(); - this.players = new Map(); - const ytoptions: { - gl?: string; - cookie?: string; - debug?: boolean; - potoken?: { - token?: string; - visitorData?: string; - }; - } = {}; - if (config.searchOptions?.youtubeCookie) { - ytoptions.cookie = config.searchOptions?.youtubeCookie; - } - if (config.searchOptions?.youtubegl) { - ytoptions.cookie = config.searchOptions?.youtubegl ?? "US"; - } - if (config.searchOptions?.youtubeToken) { - const requestKey = "O43z0dpjhgX20SCx4KAo"; - - /* - * This function generates a YouTube PoToken using BotGuard. - * https://github.com/LuanRT/BgUtils/blob/main/examples/node/main.mjs - * - */ - async function generateYoutubePoToken(): Promise { - let innertube = await Innertube.create({ retrieve_player: false }); - - const requestKey = "O43z0dpjhgX20SCx4KAo"; - const visitorData = innertube.session.context.client.visitorData; - - const dom = new JSDOM(); - - Object.assign(globalThis, { - window: dom.window, - document: dom.window.document, - }); - - const bgConfig = { - fetch: (url, options) => fetch(url, options), - globalObj: globalThis, - identifier: visitorData, - requestKey, + configs: ManagerConfigurations; + players: Map; + platforms: { youtube: Promise; spotify?: Spotify; soundcloud: SCDL }; + plugins: Map> = new Map>(); + spotifyApi: SpotifyWebApi; + + constructor(config?: ManagerConfigurations) { + super(); + this.#validateConfig(config); + this.configs = config ?? Manager.defaultConfig(); + this.players = new Map(); + const ytoptions: { + youtubeCookie: string; + gl?: string; + cookie?: string; + debug?: boolean; + potoken?: { + token?: string; + visitorData?: string; + }; + } = { + youtubeCookie: "" }; + if (config.searchOptions?.youtubeCookie) { + ytoptions.cookie = config.searchOptions?.youtubeCookie; + } + if (config.searchOptions?.youtubegl) { + ytoptions.cookie = config.searchOptions?.youtubegl ?? "US"; + } + if (config.searchOptions?.youtubeToken) { + /* + * This function generates a YouTube PoToken using BotGuard. + * https://github.com/LuanRT/BgUtils/blob/main/examples/node/main.mjs + */ + async function generateYoutubePoToken(): Promise { + let innertube = await Innertube.create({ retrieve_player: false }); + + const requestKey = "O43z0dpjhgX20SCx4KAo"; + const visitorData = innertube.session.context.client.visitorData; + + const dom = new JSDOM(); + + Object.assign(globalThis, { + window: dom.window, + document: dom.window.document + }); + + const bgConfig: BgConfig = { + // @ts-ignore + fetch: (input: RequestInfo, init?: RequestInit) => fetch(input as any, init as any), + globalObj: globalThis, + identifier: visitorData, + requestKey + }; - // @ts-expect-error - return BG.Challenge.create(bgConfig) - .then((challenge) => { - if (!challenge) - throw new Error( - "[@aoijs/aoi.music]: Could not get challenge, remove the youtubeToken option if this error persists" - ); - - if (challenge.script) { - const script = challenge.script.find((sc) => sc !== null); - if (script) new Function(script)(); - } else { - console.warn("[@aoijs/aoi.music]: Failed to load BotGuard."); + return BG.Challenge.create(bgConfig) + .then(async (challenge) => { + if (!challenge) throw new Error("[@aoijs/aoi.music]: Could not get challenge, remove the youtubeToken option if this error persists"); + + const interpreterJavascript = challenge.interpreterJavascript.privateDoNotAccessOrElseSafeScriptWrappedValue; + + if (interpreterJavascript) { + new Function(interpreterJavascript)(); + } else throw new Error("[aoi.music]: Could not create VM, set the youtubeToken option to 'false' if this error persists"); + + const poTokenResult = await BG.PoToken.generate({ + program: challenge.program, + globalName: challenge.globalName, + bgConfig + }); + + /* + #DEBUG POT generation + const placeholderPoToken = BG.PoToken.generatePlaceholder(visitorData); + + console.info("Session Info:", { + visitorData, + placeholderPoToken, + poToken: poTokenResult.poToken, + integrityTokenData: poTokenResult.integrityTokenData, + }); + */ + + if (!poTokenResult.poToken) { + throw new Error("[aoi.music]: Could not generate POT, set the youtubeToken option to 'false' if this error persists"); + } + + return poTokenResult.poToken; + }) + .then((poToken) => { + const authPath = join(__dirname, "./credentials.json"); + if (!existsSync(authPath)) { + writeFileSync(authPath, "{}"); + } + const credentials = JSON.parse(readFileSync(authPath, "utf-8")); + credentials.poToken = poToken; + credentials.visitorData = visitorData; + writeFileSync(authPath, JSON.stringify(credentials)); + if (config.devOptions?.debug) { + console.log("#DEBUG PoToken:", poToken); + console.log("#DEBUG VisitorData:", visitorData); + } + ytoptions.potoken = { token: poToken, visitorData }; + }) + .catch((error) => { + console.error("[@aoijs/aoi.music]: Failed to generate YouTube PoToken:", error); + }); } - return BG.PoToken.generate({ - program: challenge.challenge, - globalName: challenge.globalName, - // @ts-ignore - bgConfig, + generateYoutubePoToken(); + } + // prevent future class changes from being logged to console + // so people don't get confused about those *absolutely* irrelevant logs + Log.setLevel(Log.Level.NONE); + const youtubeOptions: any = { + cache: new UniversalCache(true) + }; + if (ytoptions.potoken?.token && ytoptions.potoken?.visitorData) { + youtubeOptions.po_token = ytoptions.potoken.token; + youtubeOptions.visitor_data = ytoptions.potoken.visitorData; + } + if (ytoptions.youtubeCookie) { + youtubeOptions.cookies = ytoptions.youtubeCookie; + } + + this.platforms = { + youtube: Innertube.create(youtubeOptions), + soundcloud: scdl, + spotify: sui(fetch) + }; + if (config.searchOptions?.spotifyAuth?.clientId && config.searchOptions?.spotifyAuth?.clientSecret) { + this.spotifyApi = new SpotifyWebApi({ + clientId: config.searchOptions?.spotifyAuth?.clientId, + clientSecret: config.searchOptions?.spotifyAuth?.clientSecret }); - }) - .then((poToken) => { - const authPath = join(__dirname, "./credentials.json"); - if (!existsSync(authPath)) { - writeFileSync(authPath, "{}"); - } - const credentials = JSON.parse(readFileSync(authPath, "utf-8")); - credentials.poToken = poToken; - credentials.visitorData = visitorData; - writeFileSync(authPath, JSON.stringify(credentials)); - if (config.devOptions?.debug) { - console.log("#DEBUG PoToken:", poToken); - console.log("#DEBUG VisitorData:", visitorData); - } - ytoptions.potoken = { token: poToken, visitorData }; - }) - .catch((error) => { - console.error( - "[@aoijs/aoi.music]: Failed to generate YouTube PoToken:", - error - ); - }); - } - generateYoutubePoToken(); - } - // prevent future class changes from being logged to console - // so people don't get confused about those *absolutely* irrelevant logs - Log.setLevel(Log.Level.NONE); - const youtubeOptions: any = { - cache: new UniversalCache(true), - }; - if (ytoptions.potoken?.token && ytoptions.potoken?.visitorData) { - youtubeOptions.po_token = ytoptions.potoken.token; - youtubeOptions.visitor_data = ytoptions.potoken.visitorData; - } - this.platforms = { - youtube: Innertube.create(youtubeOptions), - soundcloud: scdl, - spotify: sui(fetch), - }; - if ( - config.searchOptions?.spotifyAuth?.clientId && - config.searchOptions?.spotifyAuth?.clientSecret - ) { - this.spotifyApi = new SpotifyWebApi({ - clientId: config.searchOptions?.spotifyAuth?.clientId, - clientSecret: config.searchOptions?.spotifyAuth?.clientSecret, - }); - - this.spotifyApi.clientCredentialsGrant().then((data) => { - this.spotifyApi.setAccessToken(data.body.access_token); - }); - - setInterval(() => { - this.spotifyApi.clientCredentialsGrant().then((data) => { - this.spotifyApi.setAccessToken(data.body.access_token); - }); - }, 36e5); - } + this.spotifyApi.clientCredentialsGrant().then((data) => { + this.spotifyApi.setAccessToken(data.body.access_token); + }); - if (config.searchOptions?.soundcloudClientId) { - this.platforms.soundcloud.setClientID( - config.searchOptions.soundcloudClientId - ); - } - if (config.searchOptions?.youtubeAuth === true) { - this.platforms.youtube.then(async (yt) => { - // should be inside of node_modules - const authPath = join(__dirname, "./credentials.json"); - let authData = {}; - - if (!existsSync(authPath)) { - writeFileSync(authPath, "{}"); + setInterval(() => { + this.spotifyApi.clientCredentialsGrant().then((data) => { + this.spotifyApi.setAccessToken(data.body.access_token); + }); + }, 36e5); } - if (existsSync(authPath)) { - const fileContent = readFileSync(authPath, "utf8"); - authData = JSON.parse(fileContent); + if (config.searchOptions?.soundcloudClientId) { + this.platforms.soundcloud.setClientID(config.searchOptions.soundcloudClientId); + } + if (config.searchOptions?.youtubeAuth) { + throw new Error("[aoi.music]: 'youtubeAuth' is deprecated, please migrate to the 'youtubeCookie' method. Learn more here: https://github.com/aoijs/aoi.music/wiki/Youtube-Cookies-and-oAuth"); } + /* Youtube nuked oAuth for non-tv clients + if (config.searchOptions?.youtubeAuth === true) { + if (config.searchOptions?.youtubeClient !== "WEB_EMBEDDED") { + throw new Error("[aoi.music]: oAuth2 is only availble for the 'WEB_EMBEDDED' client") + } + this.platforms.youtube.then(async (yt) => { + // should be inside of node_modules + const authPath = join(__dirname, "./credentials.json"); + let authData = {}; - yt.session.on("auth-pending", (data) => { - console.log( - `[@aoijs/aoi.music]: Sign in pending: visit ${data.verification_url} and enter ${data.user_code} to sign in.` - ); - }); - - const updateCredentials = (credentials: Partial) => { - const current: Credentials = JSON.parse( - readFileSync(authPath, "utf-8") - ); - - const { visitorData, poToken } = current; - const newCredentials: Credentials = { - visitorData, - poToken, - ...credentials, - }; - - writeFileSync(authPath, JSON.stringify(newCredentials)); - }; + if (!existsSync(authPath)) { + writeFileSync(authPath, "{}"); + } - yt.session.on("auth", ({ credentials }) => { - yt.session.oauth.cacheCredentials(); - updateCredentials(credentials); - console.log("[@aoijs/aoi.music]: Successfully signed in."); - }); - - yt.session.on("update-credentials", ({ credentials }) => { - yt.session.oauth.cacheCredentials(); - updateCredentials(credentials); - }); - - // check if access_token exists in file, if not skip to signin - if ( - existsSync(authPath) && - JSON.parse(readFileSync(authPath, "utf-8")).access_token - ) { - try { - const credentials = JSON.parse(readFileSync(authPath, "utf-8")); - // remove unneeded data - delete credentials.visitorData; - delete credentials.poToken; - console.log( - "[@aoijs/aoi.music]: Attempting to sign in with cached credentials." - ); - await yt.session.signIn(credentials); - } catch { - console.warn( - "[@aoijs/aoi.music]: Failed to sign in with cached credentials, please reauthenticate." - ); - const { visitorData, poToken } = JSON.parse( - readFileSync(authPath, "utf-8") - ); - writeFileSync( - authPath, - JSON.stringify({ visitorData, poToken }, null, 2) - ); - yt.session.oauth.removeCache(); - await yt.session.signIn(); - } - } else { - yt.session.signIn(); + if (existsSync(authPath)) { + const fileContent = readFileSync(authPath, "utf8"); + authData = JSON.parse(fileContent); + } + + yt.session.on("auth-pending", (data) => { + console.log(`[@aoijs/aoi.music]: Sign in pending: visit ${data.verification_url} and enter ${data.user_code} to sign in.`); + }); + + const updateCredentials = (credentials: Partial) => { + const current: Credentials = JSON.parse(readFileSync(authPath, "utf-8")); + + const { visitorData, poToken } = current; + const newCredentials: Credentials = { + visitorData, + poToken, + ...credentials + }; + + writeFileSync(authPath, JSON.stringify(newCredentials)); + }; + + yt.session.on("auth", ({ credentials }) => { + yt.session.oauth.cacheCredentials(); + updateCredentials(credentials); + console.log("[@aoijs/aoi.music]: Successfully signed in."); + }); + + yt.session.on("update-credentials", ({ credentials }) => { + yt.session.oauth.cacheCredentials(); + updateCredentials(credentials); + }); + + // check if access_token exists in file, if not skip to signin + if (existsSync(authPath) && JSON.parse(readFileSync(authPath, "utf-8")).access_token) { + try { + const credentials = JSON.parse(readFileSync(authPath, "utf-8")); + // remove unneeded data + delete credentials.visitorData; + delete credentials.poToken; + console.log("[@aoijs/aoi.music]: Attempting to sign in with cached credentials."); + await yt.session.signIn(credentials); + } catch { + console.warn("[@aoijs/aoi.music]: Failed to sign in with cached credentials, please reauthenticate."); + const { visitorData, poToken } = JSON.parse(readFileSync(authPath, "utf-8")); + writeFileSync(authPath, JSON.stringify({ visitorData, poToken }, null, 2)); + yt.session.oauth.removeCache(); + await yt.session.signIn(); + } + } else { + yt.session.signIn(); + } + }); } - }); + */ } - } - - static defaultConfig(): ManagerConfigurations { - return { - devOptions: { - debug: false, - }, - searchOptions: { - soundcloudClientId: undefined, - youtubeCookie: undefined, - youtubeAuth: true, - youtubeToken: true, - youtubegl: "US", - youtubeClient: "TV_EMBEDDED", - spotifyAuth: { - clientId: undefined, - clientSecret: undefined, - }, - }, - requestOptions: { - offsetTimeout: 500, - soundcloudLikeTrackLimit: -1, - youtubePlaylistLimit: -1, - spotifyPlaylistLimit: -1, - }, - }; - } - - #validateConfig(config: ManagerConfigurations) { - if ( - config.requestOptions?.offsetTimeout && - (typeof config.requestOptions.offsetTimeout !== "number" || - config.requestOptions.offsetTimeout < 0) - ) { - throw new Error( - `Invalid Time Provided in ManagerConfig#requestOptions['offsetTimeout']` - ); - } else if ( - config.requestOptions?.soundcloudLikeTrackLimit && - (typeof config.requestOptions.soundcloudLikeTrackLimit !== "number" || - config.requestOptions.soundcloudLikeTrackLimit < -1) - ) { - throw new Error( - `Invalid Limit Provided in ManagerConfig#requestOptions['soundcloudLikeTrackLimit']` - ); - } else if ( - config.requestOptions?.youtubePlaylistLimit && - (typeof config.requestOptions.youtubePlaylistLimit !== "number" || - config.requestOptions.youtubePlaylistLimit < -1) - ) { - throw new Error( - `Invalid Limit Provided in ManagerConfig#requestOptions['youtubePlaylistLimit']` - ); - } else if ( - config.requestOptions?.spotifyPlaylistLimit && - (typeof config.requestOptions.spotifyPlaylistLimit !== "number" || - config.requestOptions.spotifyPlaylistLimit < -1) - ) { - throw new Error( - `Invalid Limit Provided in ManagerConfig#requestOptions['spotifyPlaylistLimit']` - ); - } else if ( - config.devOptions?.debug && - typeof config.devOptions.debug !== "boolean" - ) { - throw new Error( - `Invalid Debug Option Provided in ManagerConfig#devOptions['debug']` - ); + + static defaultConfig(): ManagerConfigurations { + return { + devOptions: { + debug: false + }, + searchOptions: { + soundcloudClientId: undefined, + youtubeCookie: undefined, + youtubeToken: true, + youtubegl: "US", + youtubeClient: "WEB_EMBEDDED", + spotifyAuth: { + clientId: undefined, + clientSecret: undefined + } + }, + requestOptions: { + offsetTimeout: 500, + soundcloudLikeTrackLimit: -1, + youtubePlaylistLimit: -1, + spotifyPlaylistLimit: -1 + } + }; } - if (config.devOptions?.debug) { - console.log("Debug Mode Enabled"); + + #validateConfig(config: ManagerConfigurations) { + if (config.requestOptions?.offsetTimeout && (typeof config.requestOptions.offsetTimeout !== "number" || config.requestOptions.offsetTimeout < 0)) { + throw new Error(`Invalid Time Provided in ManagerConfig#requestOptions['offsetTimeout']`); + } else if (config.requestOptions?.soundcloudLikeTrackLimit && (typeof config.requestOptions.soundcloudLikeTrackLimit !== "number" || config.requestOptions.soundcloudLikeTrackLimit < -1)) { + throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['soundcloudLikeTrackLimit']`); + } else if (config.requestOptions?.youtubePlaylistLimit && (typeof config.requestOptions.youtubePlaylistLimit !== "number" || config.requestOptions.youtubePlaylistLimit < -1)) { + throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['youtubePlaylistLimit']`); + } else if (config.requestOptions?.spotifyPlaylistLimit && (typeof config.requestOptions.spotifyPlaylistLimit !== "number" || config.requestOptions.spotifyPlaylistLimit < -1)) { + throw new Error(`Invalid Limit Provided in ManagerConfig#requestOptions['spotifyPlaylistLimit']`); + } else if (config.devOptions?.debug && typeof config.devOptions.debug !== "boolean") { + throw new Error(`Invalid Debug Option Provided in ManagerConfig#devOptions['debug']`); + } + if (config.devOptions?.debug) { + console.log("Debug Mode Enabled"); + } } - } - - async joinVc({ - type = "default", - voiceChannel, - selfDeaf = true, - selfMute = false, - adapter, - }: { - type: AudioPLayerOptions["type"]; - voiceChannel: VoiceBasedChannel; - selfDeaf?: boolean; - selfMute?: boolean; - adapter?: any; - }): Promise { - const data = { - channelId: voiceChannel.id, - guildId: voiceChannel.guild.id, - selfDeaf, - selfMute, - adapterCreator: < - DiscordGatewayAdapterCreator // @ts-ignore - >(adapter ? adapter : voiceChannel.guild?.voiceAdapterCreator ?? adapter), - group: voiceChannel.client.user.id, - }; - // destory player if already exists to prevent memory leaks - if (this.players.has(data.guildId)) { - const player = this.players.get(data.guildId); - player?._destroy(); - this.players.delete(data.guildId); - player.options.connection.destroy(); + + async joinVc({ type = "default", voiceChannel, selfDeaf = true, selfMute = false, adapter }: { type: AudioPLayerOptions["type"]; voiceChannel: VoiceBasedChannel; selfDeaf?: boolean; selfMute?: boolean; adapter?: any }): Promise { + const data = { + channelId: voiceChannel.id, + guildId: voiceChannel.guild.id, + selfDeaf, + selfMute, + adapterCreator: < + DiscordGatewayAdapterCreator // @ts-ignore + >(adapter ? adapter : voiceChannel.guild?.voiceAdapterCreator ?? adapter), + group: voiceChannel.client.user.id + }; + // destory player if already exists to prevent memory leaks + if (this.players.has(data.guildId)) { + const player = this.players.get(data.guildId); + player?._destroy(); + this.players.delete(data.guildId); + player.options.connection.destroy(); + } + const connection = joinVoiceChannel(data); + connection.on("error", console.error); + try { + await entersState(connection, VoiceConnectionStatus.Ready, 30000); + this.players.set( + voiceChannel.guildId, + new AudioPlayer({ + type, + connection, + voiceChannel: voiceChannel.id, + manager: this, + debug: this.configs.devOptions?.debug ?? false + }) + ); + if (this.configs.devOptions?.debug) { + console.log(`#DEBUG:\n Class -> Manager \n Method -> joinVc \n Message -> Joined Voice Channel ${voiceChannel.name} in Guild ${voiceChannel.guild.name}`); + } + return true; + } catch (error) { + connection.destroy(); + if (this.configs.devOptions?.debug) { + console.log(`#DEBUG:\n Class -> Manager \n Method -> joinVc \n Message -> Failed to join Voice Channel ${voiceChannel.name} in Guild ${voiceChannel.guild.name}`); + } + return false; + } } - const connection = joinVoiceChannel(data); - connection.on("error", console.error); - try { - await entersState(connection, VoiceConnectionStatus.Ready, 30000); - this.players.set( - voiceChannel.guildId, - new AudioPlayer({ - type, - connection, - voiceChannel: voiceChannel.id, - manager: this, - debug: this.configs.devOptions?.debug ?? false, - }) - ); - if (this.configs.devOptions?.debug) { - console.log( - `#DEBUG:\n Class -> Manager \n Method -> joinVc \n Message -> Joined Voice Channel ${voiceChannel.name} in Guild ${voiceChannel.guild.name}` - ); - } - return true; - } catch (error) { - connection.destroy(); - if (this.configs.devOptions?.debug) { - console.log( - `#DEBUG:\n Class -> Manager \n Method -> joinVc \n Message -> Failed to join Voice Channel ${voiceChannel.name} in Guild ${voiceChannel.guild.name}` - ); - } - return false; + + async search(type: T, query: string, limit = 1) { + if (type === PlatformType.Youtube) { + const yt = await this.platforms.youtube; + const res = await yt.search(query, { + type: "video" + }); + return res.videos.slice(0, limit); + } else if (type === PlatformType.SoundCloud) { + const sc = this.platforms.soundcloud; + const res = await sc.search({ + query, + limit, + offset: 0, + resourceType: "tracks" + }); + return res.collection; + } else if (type === PlatformType.Spotify) { + const res = await this.spotifyApi.searchTracks(query, { + limit + }); + return res.body.tracks.items; + } } - } - - async search(type: T, query: string, limit = 1) { - if (type === PlatformType.Youtube) { - const yt = await this.platforms.youtube; - const res = await yt.search(query, { - type: "video", - }); - return res.videos.slice(0, limit); - } else if (type === PlatformType.SoundCloud) { - const sc = this.platforms.soundcloud; - const res = await sc.search({ - query, - limit, - offset: 0, - resourceType: "tracks", - }); - return res.collection; - } else if (type === PlatformType.Spotify) { - const res = await this.spotifyApi.searchTracks(query, { - limit, - }); - return res.body.tracks.items; + + addPlugin(name: A, plugin: Plugin) { + this.plugins.set(name, plugin); + if (this.configs.devOptions?.debug) { + console.log(`#DEBUG:\n Class -> Manager \n Method -> addPlugin \n Message -> Added Plugin ${plugin.constructor.name} with name : ${name} `); + } } - } - - addPlugin(name: A, plugin: Plugin) { - this.plugins.set(name, plugin); - if (this.configs.devOptions?.debug) { - console.log( - `#DEBUG:\n Class -> Manager \n Method -> addPlugin \n Message -> Added Plugin ${plugin.constructor.name} with name : ${name} ` - ); + leaveVc(guildId: string) { + const player = this.players.get(guildId); + player?._destroy(); + this.players.delete(guildId); + return player.options.connection.destroy(); } - } - leaveVc(guildId: string) { - const player = this.players.get(guildId); - player?._destroy(); - this.players.delete(guildId); - return player.options.connection.destroy(); - } } diff --git a/src/newutils/request.ts b/src/newutils/request.ts index 12a131a..b3714b0 100755 --- a/src/newutils/request.ts +++ b/src/newutils/request.ts @@ -170,14 +170,12 @@ export async function requestInfo(id: strin } else if (type === "LocalFile" || type === "Url") { return >(generateInfo(id, type)); } else if (type === "Youtube") { - const ytData: any = await (await manager.platforms.youtube).getBasicInfo(id, manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED").catch((_) => undefined); + const ytData: any = await (await manager.platforms.youtube).getBasicInfo(id, manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED").catch((_) => undefined); if (!ytData) return; return >({ title: ytData.basic_info.title, channelId: ytData.basic_info.channel_id, artist: ytData.basic_info?.author ?? "Unknown", - // remove soon in favour of channelUrl, better naming - artistURL: `https://youtube.com/channel/${ytData.basic_info.channel_id}`, channelUrl: `https://youtube.com/channel/${ytData.basic_info.channel_id}`, duration: ytData.basic_info.duration * 1000, description: ytData.basic_info.short_description, @@ -209,6 +207,8 @@ export async function requestInfo(id: strin data = parse(data); data = await spotify.getData(formatOpenURL(data)); + console.log(require("util").inspect(data, { depth: 1 })); + if (data.type === "track") return >({ title: data.name, artist: data.artists.map((a: { name: any }) => a.name).join(", "), @@ -218,7 +218,7 @@ export async function requestInfo(id: strin identifier: "spotify", views: 0, likes: 0, - thumbnail: data.coverArt.sources[0].url, + thumbnail: data.coverArt ? data.coverArt.sources[0].url : null, spotifyId: data.id, id: null, description: null, @@ -266,7 +266,7 @@ export async function requestInfo(id: strin identifier: "spotify", views: 0, likes: 0, - thumbnail: x.coverArt.sources[0].url, + thumbnail: x.coverArt ? x.coverArt.sources[0].url : null, spotifyId: x.id, id: null, description: null, @@ -292,7 +292,7 @@ export async function requestInfo(id: strin identifier: "spotify", views: 0, likes: 0, - thumbnail: x.coverArt.sources[0].url, + thumbnail: x.coverArt ? x.coverArt.sources[0].url : null, spotifyId: x.id, id: null, description: null, @@ -335,7 +335,7 @@ export async function requestStream(track: const yt = await manager.platforms.youtube; return Readable.fromWeb( (await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" })) as ReadableStream @@ -350,7 +350,7 @@ export async function requestStream(track: track.id = data.videos[0].id; return Readable.fromWeb( (await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" })) as ReadableStream @@ -358,7 +358,7 @@ export async function requestStream(track: } else { return Readable.fromWeb( (await yt.download(track.id, { - client: manager.configs.searchOptions?.youtubeClient ?? "TV_EMBEDDED", + client: manager.configs.searchOptions?.youtubeClient ?? "WEB_EMBEDDED", quality: "best", type: "audio" })) as ReadableStream diff --git a/src/typings/interfaces.ts b/src/typings/interfaces.ts index 793714b..d9c7b62 100755 --- a/src/typings/interfaces.ts +++ b/src/typings/interfaces.ts @@ -3,6 +3,7 @@ import { Manager } from "./../newstruct/manager"; import { VoiceConnection } from "@discordjs/voice"; import { AutoPlay, LoopMode, PlayerEvents } from "./enums"; import { AudioPlayer } from "../newstruct/audioPlayer"; +import { Constants } from "youtubei.js"; import { Track, SpotifyTrackInfo, YoutubeTrackInfo, LocalFileTrackInfo, SoundCloudTrackInfo, UrlTrackInfo } from "./types"; export interface ManagerConfigurations { @@ -15,7 +16,7 @@ export interface ManagerConfigurations { youtubeCookie?: string; youtubeAuth?: boolean; youtubegl?: string; - youtubeClient?: "WEB" | "ANDROID" | "YTMUSIC_ANDROID" | "YTMUSIC" | "YTSTUDIO_ANDROID" | "TV_EMBEDDED"; + youtubeClient?: Exclude; youtubeToken?: boolean; }; requestOptions?: { diff --git a/src/typings/types.ts b/src/typings/types.ts index e034553..bd0deda 100755 --- a/src/typings/types.ts +++ b/src/typings/types.ts @@ -96,14 +96,6 @@ export type SpotifyTrackInfo = { requester: GuildMember; position: number; }; -export type Track = type extends "SoundCloud" - ? SoundCloudTrackInfo - : type extends "LocalFile" - ? LocalFileTrackInfo - : type extends "Url" - ? UrlTrackInfo - : type extends "Youtube" - ? YoutubeTrackInfo - : SpotifyTrackInfo; +export type Track = type extends "SoundCloud" ? SoundCloudTrackInfo : type extends "LocalFile" ? LocalFileTrackInfo : type extends "Url" ? UrlTrackInfo : type extends "Youtube" ? YoutubeTrackInfo : SpotifyTrackInfo; export type Plugin = T extends PluginName.Cacher ? Cacher<"memory" | "disk"> : Filter;