From 495970ffe9d5b00c2d27e886105fea7696d8623e Mon Sep 17 00:00:00 2001 From: NoLogicAlan Date: Mon, 23 Nov 2026 03:22:39 +0300 Subject: [PATCH] feat(playlists): support YouTube, Spotify, SoundCloud, and Apple Music imports with 250-track capacity --- commands/playlist.mjs | 233 ++++++++++++++++++++++++++++++- src/services/PlaylistManager.mjs | 55 +++++++- storage/locales/bot/ar-SA.json | 10 +- storage/locales/bot/ckb.json | 10 +- storage/locales/bot/de-DE.json | 10 +- storage/locales/bot/en.json | 10 +- storage/locales/bot/pt-BR.json | 10 +- storage/locales/bot/tr.json | 10 +- storage/locales/bot/zh-CN.json | 10 +- storage/locales/bot/zh-TW.json | 10 +- 10 files changed, 335 insertions(+), 33 deletions(-) diff --git a/commands/playlist.mjs b/commands/playlist.mjs index 7bec332..82efa6e 100644 --- a/commands/playlist.mjs +++ b/commands/playlist.mjs @@ -1,6 +1,6 @@ /** * @module commands/playlist - * @description Save the active queue or manage personal custom playlists across servers. + * @description Save the active queue or import playlists from YouTube, Spotify, SoundCloud, Apple Music and more. */ import { CommandBuilder } from "../src/commands/index.mjs"; @@ -15,10 +15,107 @@ const COLOR_PRIMARY = 0xe9196c; const COLOR_SUCCESS = 0x2ecc71; const COLOR_ERROR = 0xe74c3c; +/** + * Format raw source identifiers into friendly labels. + * @param {string} raw + * @returns {string} + */ +function formatSourceName(raw) { + const s = String(raw || "").toLowerCase(); + if (s.includes("spotify")) return "Spotify"; + if (s.includes("youtube") || s.includes("yt")) return "YouTube"; + if (s.includes("soundcloud")) return "SoundCloud"; + if (s.includes("apple") || s.includes("applemusic")) return "Apple Music"; + if (s.includes("deezer")) return "Deezer"; + if (s.includes("tidal")) return "Tidal"; + if (s.includes("bandcamp")) return "Bandcamp"; + return "External Source"; +} + +/** + * Resolve tracks from an external URL (YouTube, Spotify, SoundCloud, Apple Music, Deezer, etc.) via Lavalink. + * @param {object} bot - The bot instance. + * @param {string} url - The URL to resolve. + * @returns {Promise<{name: string|null, tracks: Array, source: string}>} + */ +async function resolveExternalPlaylist(bot, url) { + if (!bot.lavalink) return { name: null, tracks: [], source: "unknown" }; + await bot.lavalink.waitForNode({ timeoutMs: 10_000 }).catch(() => {}); + + const cleanUrl = url.trim(); + + /* Canonicalize YouTube playlist queries if needed */ + let searchQuery = cleanUrl; + const ytId = Utils.extractYouTubeId(cleanUrl); + const canonicalYt = ytId ? Utils.normalizeYouTubeUrl(cleanUrl) : null; + if (ytId && canonicalYt) { + try { + const listId = new URL(cleanUrl).searchParams.get("list"); + if (listId) searchQuery = canonicalYt + "&list=" + listId; + } catch (_) {} + } + + let result = null; + try { + result = await bot.lavalink.search(searchQuery); + } catch (err) { + logger.warn("[playlist] External resolve failed:", err?.message); + return { name: null, tracks: [], source: "unknown" }; + } + + const rawTracks = result?.tracks || []; + if (rawTracks.length === 0) { + return { name: null, tracks: [], source: "unknown" }; + } + + const playlistName = result?.playlistInfo?.name ?? result?.info?.name ?? null; + const allRawTracks = [...rawTracks]; + + /* Support LavaSrc / NodeLink pagination for large external playlists */ + let nextPageToken = result?.pluginInfo?.nextPageToken ?? result?.playlistInfo?.nextPageToken; + let page = 1; + const maxPages = 6; + while (nextPageToken && page < maxPages && allRawTracks.length < MAX_TRACKS_PER_PLAYLIST) { + try { + page++; + const nextResult = await bot.lavalink.search(searchQuery, { + page, + pageToken: nextPageToken, + }); + const nextTracks = nextResult?.tracks || []; + if (nextTracks.length === 0) break; + allRawTracks.push(...nextTracks); + nextPageToken = nextResult?.pluginInfo?.nextPageToken ?? nextResult?.playlistInfo?.nextPageToken; + } catch (_) { + break; + } + } + + const tracks = allRawTracks.slice(0, MAX_TRACKS_PER_PLAYLIST).map(t => { + const info = t.info ?? t ?? {}; + let ms = info.length ?? t.length ?? info.durationMs ?? 0; + let trackUri = info.uri ?? ("https://www.youtube.com/watch?v=" + (info.identifier || "")); + if (typeof trackUri === "string" && trackUri.includes("music.youtube.com")) { + trackUri = trackUri.replace("music.youtube.com", "www.youtube.com"); + } + return { + title: Utils.cleanTitle(info.title ?? "Unknown"), + author: info.author ?? "Unknown", + uri: trackUri, + durationMs: ms, + sourceName: info.sourceName ?? "unknown", + thumbnail: info.artworkUrl ?? null, + }; + }).filter(t => t.uri.length > 0); + + const detectedSource = tracks[0]?.sourceName || "external"; + return { name: playlistName, tracks, source: detectedSource }; +} + /** @type {CommandBuilder} */ export const command = new CommandBuilder() .setName("playlist") - .setDescription("Save the current queue or manage your personal custom playlists.", "commands.playlist") + .setDescription("Save the current queue or import playlists from YouTube, Spotify, SoundCloud, Apple Music and more.", "commands.playlist") .addAliases("pl", "playlists") .setCategory("music") .addTextOption((o) => @@ -56,7 +153,7 @@ export async function run(msg, data) { let sub = data?.action || ""; if (!sub) { - if (["save", "create", "new"].includes(firstToken)) sub = "save"; + if (["save", "create", "new", "import"].includes(firstToken)) sub = "save"; else if (["play", "p", "load"].includes(firstToken)) sub = "play"; else if (["list", "all"].includes(firstToken)) sub = "list"; else if (["show", "view", "info"].includes(firstToken)) sub = "show"; @@ -72,10 +169,80 @@ export async function run(msg, data) { } /* ------------------------------------------------------------------------- - SUBCOMMAND: SAVE + SUBCOMMAND: SAVE / IMPORT ------------------------------------------------------------------------- */ - if (sub === "save" || sub === "create" || sub === "new") { - let name = rawParts.length > 1 ? rawParts[1] : null; + if (sub === "save" || sub === "create" || sub === "new" || sub === "import") { + let name = null; + let url = null; + + /* Scan arguments to distinguish custom playlist name and optional source URL */ + for (let i = 1; i < rawParts.length; i++) { + const part = rawParts[i]; + if (Utils.isValidUrl(part)) { + url = part; + } else if (!name) { + name = part; + } + } + + /* Case A: URL provided — import tracks from YouTube, Spotify, SoundCloud, Apple Music, etc. */ + if (url) { + const sourceLabel = formatSourceName(url); + const loadingEmbed = new EmbedBuilder() + .setColor(embedColor) + .setDescription(this.t(msg, "responses.playlist.resolving", { source: sourceLabel })); + + let statusMsg = null; + try { + statusMsg = await msg.reply({ embeds: [loadingEmbed] }); + } catch (_) {} + + const resolved = await resolveExternalPlaylist(this, url); + if (resolved.tracks.length === 0) { + const errorEmbed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, "responses.playlist.noTracksFromSource")); + if (statusMsg) return statusMsg.edit({ embeds: [errorEmbed] }); + return msg.reply({ embeds: [errorEmbed] }); + } + + /* Fallback to external playlist name if no custom name was given */ + if (!name) { + name = resolved.name ? resolved.name.replace(/[^a-zA-Z0-9_\-\s]/g, "").slice(0, 32).trim() : null; + } + if (!name) name = `${sourceLabel.toLowerCase()}-import`; + + const res = await pm.savePlaylist(userId, name, resolved.tracks); + if (!res.success) { + let errKey = "responses.playlist.saveFailed"; + if (res.error === "LIMIT_REACHED") errKey = "responses.playlist.limitReached"; + else if (res.error === "INVALID_NAME") errKey = "responses.playlist.invalidName"; + + const failEmbed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, errKey, { max: MAX_PLAYLISTS_PER_USER })); + if (statusMsg) return statusMsg.edit({ embeds: [failEmbed] }); + return msg.reply({ embeds: [failEmbed] }); + } + + const displaySource = formatSourceName(resolved.source); + const successEmbed = new EmbedBuilder() + .setColor(COLOR_SUCCESS) + .setDescription(this.t(msg, "responses.playlist.savedFromSource", { + name: res.name, + count: res.count, + source: displaySource, + prefix, + })); + + if (statusMsg) return statusMsg.edit({ embeds: [successEmbed] }); + return msg.reply({ embeds: [successEmbed] }); + } + + /* Case B: No URL — save tracks from the active queue */ + if (!name && rawParts.length > 1) { + name = rawParts[1]; + } if (!name) { const embed = new EmbedBuilder() @@ -319,7 +486,18 @@ export async function run(msg, data) { SUBCOMMAND: ADD ------------------------------------------------------------------------- */ if (sub === "add") { - let name = rawParts.length > 1 ? rawParts[1] : null; + let name = null; + let url = null; + + /* Scan arguments for playlist name and optional URL */ + for (let i = 1; i < rawParts.length; i++) { + const part = rawParts[i]; + if (Utils.isValidUrl(part)) { + url = part; + } else if (!name) { + name = part; + } + } if (!name) { const embed = new EmbedBuilder() @@ -328,6 +506,47 @@ export async function run(msg, data) { return msg.reply({ embeds: [embed] }); } + /* Case A: Adding from URL (Spotify, YouTube, SoundCloud, Apple Music) */ + if (url) { + const resolved = await resolveExternalPlaylist(this, url); + if (resolved.tracks.length === 0) { + const embed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, "responses.playlist.noTracksFromSource")); + return msg.reply({ embeds: [embed] }); + } + + const res = await pm.addTracksToPlaylist(userId, name, resolved.tracks); + if (!res.success) { + if (res.error === "NOT_FOUND") { + const embed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, "responses.playlist.notFound", { name, prefix })); + return msg.reply({ embeds: [embed] }); + } + if (res.error === "PLAYLIST_FULL") { + const embed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, "responses.playlist.playlistFull", { max: MAX_TRACKS_PER_PLAYLIST })); + return msg.reply({ embeds: [embed] }); + } + const embed = new EmbedBuilder() + .setColor(COLOR_ERROR) + .setDescription(this.t(msg, "responses.playlist.addFailed")); + return msg.reply({ embeds: [embed] }); + } + + const embed = new EmbedBuilder() + .setColor(COLOR_SUCCESS) + .setDescription(this.t(msg, "responses.playlist.tracksAdded", { + name: res.name, + addedCount: res.addedCount, + count: res.count, + })); + return msg.reply({ embeds: [embed] }); + } + + /* Case B: Adding currently playing track */ const p = await this.getPlayer(msg, false, false, false); const current = p?.queue?.getCurrent(); diff --git a/src/services/PlaylistManager.mjs b/src/services/PlaylistManager.mjs index 4331b95..35dc710 100644 --- a/src/services/PlaylistManager.mjs +++ b/src/services/PlaylistManager.mjs @@ -6,8 +6,8 @@ import { logger } from "../core/Logger.mjs"; -export const MAX_PLAYLISTS_PER_USER = 25; -export const MAX_TRACKS_PER_PLAYLIST = 100; +export const MAX_PLAYLISTS_PER_USER = 50; +export const MAX_TRACKS_PER_PLAYLIST = 250; export const MAX_FAVORITES_PER_USER = 250; export const MAX_NAME_LENGTH = 32; @@ -496,6 +496,57 @@ export class PlaylistManager { } } + /** + * Add multiple tracks to an existing playlist up to MAX_TRACKS_PER_PLAYLIST. + * @param {string} userId + * @param {string} rawName + * @param {Array} newTracks + * @returns {Promise<{success: boolean, name: string, addedCount: number, count: number, error?: string}>} + */ + async addTracksToPlaylist(userId, rawName, newTracks) { + await this.ready(); + const name = sanitizePlaylistName(rawName); + if (!name || !Array.isArray(newTracks) || newTracks.length === 0) { + return { success: false, name, addedCount: 0, count: 0, error: "INVALID_ARG" }; + } + + const playlist = await this.getPlaylist(userId, name); + if (!playlist) { + return { success: false, name, addedCount: 0, count: 0, error: "NOT_FOUND" }; + } + + const availableSlots = MAX_TRACKS_PER_PLAYLIST - playlist.tracks.length; + if (availableSlots <= 0) { + return { success: false, name, addedCount: 0, count: playlist.tracks.length, error: "PLAYLIST_FULL" }; + } + + const sanitized = newTracks.slice(0, availableSlots).map(t => ({ + title: String(t.title || "Unknown").slice(0, 512), + author: String(t.author?.name || t.author || "").slice(0, 255), + uri: String(t.url || t.uri || ""), + durationMs: Number(t._durationMs || t.durationMs || t.duration?.seconds * 1000 || 0) || 0, + sourceName: String(t.sourceName || "unknown").slice(0, 64), + thumbnail: String(t.thumbnail || "").slice(0, 1024), + })).filter(t => t.uri.length > 0); + + if (sanitized.length === 0) { + return { success: false, name, addedCount: 0, count: playlist.tracks.length, error: "NO_VALID_TRACKS" }; + } + + playlist.tracks.push(...sanitized); + + try { + await this._pool.execute( + "UPDATE `user_playlists` SET `tracks` = ?, `updated_at` = CURRENT_TIMESTAMP WHERE `user_id` = ? AND `name` = ?", + [JSON.stringify(playlist.tracks), userId, name] + ); + return { success: true, name, addedCount: sanitized.length, count: playlist.tracks.length }; + } catch (err) { + logger.error("[PlaylistManager] Error adding tracks to playlist:", err?.message); + return { success: false, name, addedCount: 0, count: playlist.tracks.length, error: "DB_ERROR" }; + } + } + /** * Remove a track at 1-based index from a playlist. * @param {string} userId diff --git a/storage/locales/bot/ar-SA.json b/storage/locales/bot/ar-SA.json index 109b196..4648eee 100644 --- a/storage/locales/bot/ar-SA.json +++ b/storage/locales/bot/ar-SA.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "قوائم التشغيل الشخصية غير متوفرة (قاعدة البيانات غير متصلة).", - "saveUsage": "الاستخدام: `{{prefix}}playlist save <الاسم>`", + "saveUsage": "الاستخدام: `{{prefix}}playlist save <الاسم> [الرابط]`", "playUsage": "الاستخدام: `{{prefix}}playlist play <الاسم>`", "showUsage": "الاستخدام: `{{prefix}}playlist show <الاسم> [الصفحة]`", - "addUsage": "الاستخدام: `{{prefix}}playlist add <الاسم>`", + "addUsage": "الاستخدام: `{{prefix}}playlist add <الاسم> [الرابط]`", "removeUsage": "الاستخدام: `{{prefix}}playlist remove <الاسم> <رقم_المسار>`", "deleteUsage": "الاستخدام: `{{prefix}}playlist delete <الاسم>`", "emptyQueue": "لا يوجد شيء يتم تشغيله أو في قائمة الانتظار لحفظه! ابدأ بتشغيل الموسيقى أولاً باستخدام `{{prefix}}play`.", @@ -1495,7 +1495,11 @@ "trackAdded": "تمت إضافة **{{title}}** إلى قائمة التشغيل **{{name}}**! (المجموع: {{count}} مسار)", "invalidIndex": "فهرس المسار غير صالح.", "trackRemoved": "تمت إزالة **{{title}}** من قائمة التشغيل **{{name}}**! (المتبقي: {{count}} مسار)", - "deleted": "🗑️ تم حذف قائمة التشغيل **{{name}}**." + "deleted": "🗑️ تم حذف قائمة التشغيل **{{name}}**.", + "resolving": "🔎 جاري جلب المسارات من **{{source}}**...", + "savedFromSource": "💾 تم حفظ **{{count}} مسار(ات)** من **{{source}}** في قائمة **{{name}}**! شغّلها في أي وقت باستخدام `{{prefix}}playlist play {{name}}`.", + "noTracksFromSource": "تعذر العثور على أي مسارات قابلة للتشغيل من هذا الرابط.", + "tracksAdded": "تمت إضافة **{{addedCount}} مسار(ات)** إلى قائمة **{{name}}**! (الإجمالي: {{count}} مسار)" } } } diff --git a/storage/locales/bot/ckb.json b/storage/locales/bot/ckb.json index 592d6a9..da10e1d 100644 --- a/storage/locales/bot/ckb.json +++ b/storage/locales/bot/ckb.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "لیستە کەسییەکان بەردەست نین (داتابەیس پەیوەست نەکراوە).", - "saveUsage": "بەکارهێنان: `{{prefix}}playlist save <ناو>`", + "saveUsage": "بەکارهێنان: `{{prefix}}playlist save <ناو> [بەستەر]`", "playUsage": "بەکارهێنان: `{{prefix}}playlist play <ناو>`", "showUsage": "بەکارهێنان: `{{prefix}}playlist show <ناو> [پەڕە]`", - "addUsage": "بەکارهێنان: `{{prefix}}playlist add <ناو>`", + "addUsage": "بەکارهێنان: `{{prefix}}playlist add <ناو> [بەستەر]`", "removeUsage": "بەکارهێنان: `{{prefix}}playlist remove <ناو> <ژمارەی_تراک>`", "deleteUsage": "بەکارهێنان: `{{prefix}}playlist delete <ناو>`", "emptyQueue": "هیچ گۆرانییەک لێنادرێت یان لە ڕیزدا نییە بۆ پاشەکەوتکردن! سەرەتا بە `{{prefix}}play` گۆرانی لێبدە.", @@ -1495,7 +1495,11 @@ "trackAdded": "**{{title}}** زیادکرا بۆ لیستی **{{name}}**! (کۆی گشتی: {{count}} تراک)", "invalidIndex": "ژمارەی تراک هەڵەیە.", "trackRemoved": "**{{title}}** لە لیستی **{{name}}** سڕایەوە! ({{count}} تراک ماوەتەوە)", - "deleted": "🗑️ لیستی **{{name}}** سڕایەوە." + "deleted": "🗑️ لیستی **{{name}}** سڕایەوە.", + "resolving": "🔎 هێنانی تراکەکان لە **{{source}}**...", + "savedFromSource": "💾 **{{count}} تراک** لە **{{source}}** پاشەکەوت کران بۆ لیستی **{{name}}**! لە هەر کاتێک لێی بدە بە `{{prefix}}playlist play {{name}}`.", + "noTracksFromSource": "هیچ تراکێکی شیاوی لێدان لەم بەستەرە نەدۆزرایەوە.", + "tracksAdded": "**{{addedCount}} تراک** زیادکران بۆ لیستی **{{name}}**! (سەرجەم: {{count}} تراک)" } } } diff --git a/storage/locales/bot/de-DE.json b/storage/locales/bot/de-DE.json index 3390c05..d239a90 100644 --- a/storage/locales/bot/de-DE.json +++ b/storage/locales/bot/de-DE.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "Eigene Playlists sind nicht verfügbar (Datenbank getrennt).", - "saveUsage": "Verwendung: `{{prefix}}playlist save `", + "saveUsage": "Verwendung: `{{prefix}}playlist save [URL]`", "playUsage": "Verwendung: `{{prefix}}playlist play `", "showUsage": "Verwendung: `{{prefix}}playlist show [Seite]`", - "addUsage": "Verwendung: `{{prefix}}playlist add `", + "addUsage": "Verwendung: `{{prefix}}playlist add [URL]`", "removeUsage": "Verwendung: `{{prefix}}playlist remove `", "deleteUsage": "Verwendung: `{{prefix}}playlist delete `", "emptyQueue": "Es wird nichts abgespielt und die Warteschlange ist leer! Starte zuerst Musik mit `{{prefix}}play`.", @@ -1495,7 +1495,11 @@ "trackAdded": "**{{title}}** zur Playlist **{{name}}** hinzugefügt! (Gesamt: {{count}} Titel)", "invalidIndex": "Ungültiger Titel-Index.", "trackRemoved": "**{{title}}** aus Playlist **{{name}}** entfernt! ({{count}} Titel verbleibend)", - "deleted": "🗑️ Playlist **{{name}}** gelöscht." + "deleted": "🗑️ Playlist **{{name}}** gelöscht.", + "resolving": "🔎 Lade Titel von **{{source}}**...", + "savedFromSource": "💾 **{{count}} Titel** von **{{source}}** in Playlist **{{name}}** gespeichert! Spiele sie jederzeit mit `{{prefix}}playlist play {{name}}`.", + "noTracksFromSource": "Unter diesem Link konnten keine abspielbaren Titel gefunden oder geladen werden.", + "tracksAdded": "**{{addedCount}} Titel** zu Playlist **{{name}}** hinzugefügt! (Insgesamt: {{count}} Titel)" } } } diff --git a/storage/locales/bot/en.json b/storage/locales/bot/en.json index 6484c15..3f76ada 100644 --- a/storage/locales/bot/en.json +++ b/storage/locales/bot/en.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "Personal playlists are not available (database disconnected).", - "saveUsage": "Usage: `{{prefix}}playlist save `", + "saveUsage": "Usage: `{{prefix}}playlist save [url]`", "playUsage": "Usage: `{{prefix}}playlist play `", "showUsage": "Usage: `{{prefix}}playlist show [page]`", - "addUsage": "Usage: `{{prefix}}playlist add `", + "addUsage": "Usage: `{{prefix}}playlist add [url]`", "removeUsage": "Usage: `{{prefix}}playlist remove `", "deleteUsage": "Usage: `{{prefix}}playlist delete `", "emptyQueue": "There is nothing playing or in the queue to save! Start playing music first with `{{prefix}}play`.", @@ -1495,7 +1495,11 @@ "trackAdded": "Added **{{title}}** to playlist **{{name}}**! (Total: {{count}} tracks)", "invalidIndex": "Invalid track index.", "trackRemoved": "Removed **{{title}}** from playlist **{{name}}**! ({{count}} tracks remaining)", - "deleted": "🗑️ Deleted playlist **{{name}}**." + "deleted": "🗑️ Deleted playlist **{{name}}**.", + "resolving": "🔎 Resolving tracks from **{{source}}**...", + "savedFromSource": "💾 Saved **{{count}} track(s)** from **{{source}}** to playlist **{{name}}**! Play it anytime with `{{prefix}}playlist play {{name}}`.", + "noTracksFromSource": "Could not find or load any playable tracks from that link.", + "tracksAdded": "Added **{{addedCount}} track(s)** to playlist **{{name}}**! (Total: {{count}} tracks)" } } } diff --git a/storage/locales/bot/pt-BR.json b/storage/locales/bot/pt-BR.json index 75a4599..f226ee3 100644 --- a/storage/locales/bot/pt-BR.json +++ b/storage/locales/bot/pt-BR.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "Playlists pessoais indisponíveis (banco de dados desconectado).", - "saveUsage": "Uso: `{{prefix}}playlist save `", + "saveUsage": "Uso: `{{prefix}}playlist save [url]`", "playUsage": "Uso: `{{prefix}}playlist play `", "showUsage": "Uso: `{{prefix}}playlist show [página]`", - "addUsage": "Uso: `{{prefix}}playlist add `", + "addUsage": "Uso: `{{prefix}}playlist add [url]`", "removeUsage": "Uso: `{{prefix}}playlist remove `", "deleteUsage": "Uso: `{{prefix}}playlist delete `", "emptyQueue": "Nada está tocando ou na fila para salvar! Toque alguma música primeiro com `{{prefix}}play`.", @@ -1495,7 +1495,11 @@ "trackAdded": "**{{title}}** adicionada à playlist **{{name}}**! (Total: {{count}} faixas)", "invalidIndex": "Índice de faixa inválido.", "trackRemoved": "**{{title}}** removida da playlist **{{name}}**! ({{count}} faixas restantes)", - "deleted": "🗑️ Playlist **{{name}}** excluída." + "deleted": "🗑️ Playlist **{{name}}** excluída.", + "resolving": "🔎 Carregando faixas de **{{source}}**...", + "savedFromSource": "💾 Salvou **{{count}} faixa(s)** de **{{source}}** na playlist **{{name}}**! Toque a qualquer momento com `{{prefix}}playlist play {{name}}`.", + "noTracksFromSource": "Não foi possível encontrar ou carregar faixas reproduzíveis desse link.", + "tracksAdded": "Adicionou **{{addedCount}} faixa(s)** à playlist **{{name}}**! (Total: {{count}} faixas)" } } } diff --git a/storage/locales/bot/tr.json b/storage/locales/bot/tr.json index a0ebba4..0cb5a51 100644 --- a/storage/locales/bot/tr.json +++ b/storage/locales/bot/tr.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "Kişisel çalma listeleri kullanılamıyor (veritabanı bağlantısı kesildi).", - "saveUsage": "Kullanım: `{{prefix}}playlist save `", + "saveUsage": "Kullanım: `{{prefix}}playlist save [url]`", "playUsage": "Kullanım: `{{prefix}}playlist play `", "showUsage": "Kullanım: `{{prefix}}playlist show [sayfa]`", - "addUsage": "Kullanım: `{{prefix}}playlist add `", + "addUsage": "Kullanım: `{{prefix}}playlist add [url]`", "removeUsage": "Kullanım: `{{prefix}}playlist remove `", "deleteUsage": "Kullanım: `{{prefix}}playlist delete `", "emptyQueue": "Kaydedilecek hiçbir şey çalmıyor veya sırada parça yok! Önce `{{prefix}}play` ile müzik başlatın.", @@ -1495,7 +1495,11 @@ "trackAdded": "**{{title}}**, **{{name}}** listesine eklendi! (Toplam: {{count}} parça)", "invalidIndex": "Geçersiz parça indeksi.", "trackRemoved": "**{{title}}**, **{{name}}** listesinden kaldırıldı! ({{count}} parça kaldı)", - "deleted": "🗑️ **{{name}}** çalma listesi silindi." + "deleted": "🗑️ **{{name}}** çalma listesi silindi.", + "resolving": "🔎 Parçalar **{{source}}** üzerinden yükleniyor...", + "savedFromSource": "💾 **{{source}}** kaynağından **{{count}} parça** **{{name}}** çalma listesine kaydedildi! `{{prefix}}playlist play {{name}}` ile istediğiniz zaman oynatın.", + "noTracksFromSource": "Bu bağlantıdan çalınabilir hiçbir parça bulunamadı veya yüklenemedi.", + "tracksAdded": "**{{name}}** çalma listesine **{{addedCount}} parça** eklendi! (Toplam: {{count}} parça)" } } } diff --git a/storage/locales/bot/zh-CN.json b/storage/locales/bot/zh-CN.json index 150aaab..2f64ec1 100644 --- a/storage/locales/bot/zh-CN.json +++ b/storage/locales/bot/zh-CN.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "个人歌单暂不可用(数据库未连接)。", - "saveUsage": "用法:`{{prefix}}playlist save <名称>`", + "saveUsage": "用法:`{{prefix}}playlist save <名称> [链接]`", "playUsage": "用法:`{{prefix}}playlist play <名称>`", "showUsage": "用法:`{{prefix}}playlist show <名称> [页码]`", - "addUsage": "用法:`{{prefix}}playlist add <名称>`", + "addUsage": "用法:`{{prefix}}playlist add <名称> [链接]`", "removeUsage": "用法:`{{prefix}}playlist remove <名称> <序号>`", "deleteUsage": "用法:`{{prefix}}playlist delete <名称>`", "emptyQueue": "当前没有正在播放或排队的歌曲可供保存!请先使用 `{{prefix}}play` 播放音乐。", @@ -1495,7 +1495,11 @@ "trackAdded": "已将 **{{title}}** 添加到歌单 **{{name}}**!(共 {{count}} 首)", "invalidIndex": "无效的歌曲编号。", "trackRemoved": "已从歌单 **{{name}}** 移除 **{{title}}**!(剩余 {{count}} 首)", - "deleted": "🗑️ 已删除歌单 **{{name}}**。" + "deleted": "🗑️ 已删除歌单 **{{name}}**。", + "resolving": "🔎 正在从 **{{source}}** 解析曲目...", + "savedFromSource": "💾 已从 **{{source}}** 保存 **{{count}} 首曲目** 到歌单 **{{name}}**!随时使用 `{{prefix}}playlist play {{name}}` 播放。", + "noTracksFromSource": "未能从该链接找到或加载可播放的曲目。", + "tracksAdded": "已将 **{{addedCount}} 首曲目** 添加到歌单 **{{name}}**!(总计:{{count}} 首曲目)" } } } diff --git a/storage/locales/bot/zh-TW.json b/storage/locales/bot/zh-TW.json index 09df706..9356a71 100644 --- a/storage/locales/bot/zh-TW.json +++ b/storage/locales/bot/zh-TW.json @@ -1470,10 +1470,10 @@ }, "playlist": { "notAvailable": "個人播放清單暫不可用(資料庫未連線)。", - "saveUsage": "用法:`{{prefix}}playlist save <名稱>`", + "saveUsage": "用法:`{{prefix}}playlist save <名稱> [連結]`", "playUsage": "用法:`{{prefix}}playlist play <名稱>`", "showUsage": "用法:`{{prefix}}playlist show <名稱> [頁碼]`", - "addUsage": "用法:`{{prefix}}playlist add <名稱>`", + "addUsage": "用法:`{{prefix}}playlist add <名稱> [連結]`", "removeUsage": "用法:`{{prefix}}playlist remove <名稱> <序號>`", "deleteUsage": "用法:`{{prefix}}playlist delete <名稱>`", "emptyQueue": "目前沒有正在播放或佇列中的歌曲可儲存!請先使用 `{{prefix}}play` 播放音樂。", @@ -1495,7 +1495,11 @@ "trackAdded": "已將 **{{title}}** 加入播放清單 **{{name}}**!(共 {{count}} 首)", "invalidIndex": "無效的歌曲編號。", "trackRemoved": "已從播放清單 **{{name}}** 移除 **{{title}}**!(剩餘 {{count}} 首)", - "deleted": "🗑️ 已刪除播放清單 **{{name}}**。" + "deleted": "🗑️ 已刪除播放清單 **{{name}}**。", + "resolving": "🔎 正在從 **{{source}}** 解析曲目...", + "savedFromSource": "💾 已從 **{{source}}** 儲存 **{{count}} 首曲目** 到播放清單 **{{name}}**!隨時使用 `{{prefix}}playlist play {{name}}` 播放。", + "noTracksFromSource": "未能從該連結找到或載入可播放的曲目。", + "tracksAdded": "已將 **{{addedCount}} 首曲目** 新增到播放清單 **{{name}}**!(總計:{{count}} 首曲目)" } } }