diff --git a/package-lock.json b/package-lock.json index 5340f76..59f68f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "kazagumo": "^2.3.1", "kazagumo-deezer": "^1.2.2", "kazagumo-nico": "^1.1.5", - "kazagumo-spotify": "^1.1.5", + "kazagumo-spotify": "^1.2.1", "lodash": "^4.17.21", "lodash.where": "^3.1.0", "lyrics-finder": "^21.7.0", @@ -3106,11 +3106,12 @@ } }, "node_modules/kazagumo-spotify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/kazagumo-spotify/-/kazagumo-spotify-1.2.0.tgz", - "integrity": "sha512-+PBqh3nIhtGpx8/nLoM/Jw944CwSIhnqKm3JlYwKXxrJKCltoj7kS+DVloO2HfBaQwo3TSjjS/o9vqMB8NaOzA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/kazagumo-spotify/-/kazagumo-spotify-1.2.1.tgz", + "integrity": "sha512-oftAvkQjFEm4J9ID6dDaMA+s7dSPDH4sIyZ5hH1P74l0XC3JXErrCKTXCCzUrAWB6ig0qlsqEE3L+qD2pHbnFg==", "dependencies": { "kazagumo": "^2.1.6", + "shoukaku": "^3.2.2", "undici": "^5.5.1" } }, @@ -7314,11 +7315,12 @@ } }, "kazagumo-spotify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/kazagumo-spotify/-/kazagumo-spotify-1.2.0.tgz", - "integrity": "sha512-+PBqh3nIhtGpx8/nLoM/Jw944CwSIhnqKm3JlYwKXxrJKCltoj7kS+DVloO2HfBaQwo3TSjjS/o9vqMB8NaOzA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/kazagumo-spotify/-/kazagumo-spotify-1.2.1.tgz", + "integrity": "sha512-oftAvkQjFEm4J9ID6dDaMA+s7dSPDH4sIyZ5hH1P74l0XC3JXErrCKTXCCzUrAWB6ig0qlsqEE3L+qD2pHbnFg==", "requires": { "kazagumo": "^2.1.6", + "shoukaku": "^3.2.2", "undici": "^5.5.1" } }, diff --git a/package.json b/package.json index dc10fb0..3154364 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "kazagumo": "^2.3.1", "kazagumo-deezer": "^1.2.2", "kazagumo-nico": "^1.1.5", - "kazagumo-spotify": "^1.1.5", + "kazagumo-spotify": "^1.2.1", "lodash": "^4.17.21", "lodash.where": "^3.1.0", "lyrics-finder": "^21.7.0", diff --git a/src/boot/original/manager.js b/src/boot/original/manager.js index 8f5714d..bda872d 100644 --- a/src/boot/original/manager.js +++ b/src/boot/original/manager.js @@ -84,11 +84,11 @@ class Manager extends Client { const guild = this.guilds.cache.get(guildId); if (guild) guild.shard.send(payload); }, - plugins: this.config.lavalink.ENABLE_SPOTIFY + plugins: this.config.lavalink.SPOTIFY.enable ? [ new Spotify({ - clientId: this.config.SPOTIFY_ID, - clientSecret: this.config.SPOTIFY_SECRET, + clientId: this.config.lavalink.SPOTIFY.id, + clientSecret: this.config.lavalink.SPOTIFY.secret, playlistPageLimit: 1, // optional ( 100 tracks per page ) albumPageLimit: 1, // optional ( 50 tracks per page ) searchLimit: 10, // optional ( track search limit. Max 50 ) diff --git a/src/boot/shard/manager.js b/src/boot/shard/manager.js index 05f970b..7438a33 100644 --- a/src/boot/shard/manager.js +++ b/src/boot/shard/manager.js @@ -89,11 +89,11 @@ class Manager extends Client { const guild = this.guilds.cache.get(guildId); if (guild) guild.shard.send(payload); }, - plugins: this.config.lavalink.ENABLE_SPOTIFY + plugins: this.config.lavalink.SPOTIFY.enable ? [ new Spotify({ - clientId: this.config.SPOTIFY_ID, - clientSecret: this.config.SPOTIFY_SECRET, + clientId: this.config.lavalink.SPOTIFY.id, + clientSecret: this.config.lavalink.SPOTIFY.secret, playlistPageLimit: 1, // optional ( 100 tracks per page ) albumPageLimit: 1, // optional ( 50 tracks per page ) searchLimit: 10, // optional ( track search limit. Max 50 ) diff --git a/src/events/guild/interactionCreate.js b/src/events/guild/interactionCreate.js index a9b69a2..992b45f 100644 --- a/src/events/guild/interactionCreate.js +++ b/src/events/guild/interactionCreate.js @@ -21,11 +21,11 @@ const REGEX = [ module.exports = async (client, interaction) => { if ( - interaction.isCommand() || - interaction.isContextMenuCommand() || - interaction.isModalSubmit() || - interaction.isChatInputCommand() || - interaction.isAutocomplete() + interaction.isCommand() || + interaction.isContextMenuCommand() || + interaction.isModalSubmit() || + interaction.isChatInputCommand() || + interaction.isAutocomplete() ) { if (!interaction.guild || interaction.user.bot) return; if (!client.is_db_connected) @@ -177,7 +177,9 @@ module.exports = async (client, interaction) => { ) ) return interaction.user.dmChannel.send( - `${client.i18n.get(language, "interaction", "no_perms")}`, + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "SendMessages", + })}`, ); if ( !interaction.guild.members.me.permissions.has( @@ -190,8 +192,10 @@ module.exports = async (client, interaction) => { PermissionsBitField.Flags.EmbedLinks, ) ) - return interaction.reply( - `${client.i18n.get(language, "interaction", "no_perms")}`, + return interaction.user.dmChannel.send( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "EmbedLinks", + })}`, ); if (!interaction.commandName == "help") { if ( @@ -199,32 +203,40 @@ module.exports = async (client, interaction) => { PermissionsBitField.Flags.Speak, ) ) - return interaction.reply( - `${client.i18n.get(language, "interaction", "no_perms")}`, + return interaction.user.dmChannel.send( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "Speak", + })}`, ); if ( !interaction.guild.members.me.permissions.has( PermissionsBitField.Flags.Connect, ) ) - return interaction.reply( - `${client.i18n.get(language, "interaction", "no_perms")}`, + return interaction.user.dmChannel.send( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "Connect", + })}`, ); if ( !interaction.guild.members.me.permissions.has( PermissionsBitField.Flags.ManageMessages, ) ) - return interaction.reply( - `${client.i18n.get(language, "interaction", "no_perms")}`, + return interaction.user.dmChannel.send( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "ManageMessages", + })}`, ); if ( !interaction.guild.members.me.permissions.has( PermissionsBitField.Flags.ManageChannels, ) ) - return await interaction.reply( - `${client.i18n.get(language, "interaction", "no_perms")}`, + return await interaction.user.dmChannel.send( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: "ManageChannels", + })}`, ); } diff --git a/src/handlers/Player/loadContent.js b/src/handlers/Player/loadContent.js index d084d34..4913ae6 100644 --- a/src/handlers/Player/loadContent.js +++ b/src/handlers/Player/loadContent.js @@ -296,11 +296,11 @@ module.exports = async (client) => { if (!result.tracks.length) return msg.edit({ - content: `${client.i18n.get(language, "setup", "setup_content")}\n${ - Str == "" - ? `${client.i18n.get(language, "setup", "setup_content_empty")}` - : "\n" + Str - }`, + content: `${client.i18n.get( + language, + "setup", + "setup_content", + )}\n${`${client.i18n.get(language, "setup", "setup_content_empty")}`}`, }); if (result.type === "PLAYLIST") for (let track of tracks) player.queue.add(track); diff --git a/src/handlers/Player/loadUpdate.js b/src/handlers/Player/loadUpdate.js index 9b0b6fe..cc988a4 100644 --- a/src/handlers/Player/loadUpdate.js +++ b/src/handlers/Player/loadUpdate.js @@ -38,8 +38,22 @@ module.exports = async (client) => { })}`, ); + const current_song = `${client.i18n.get( + language, + "setup", + "setup_content_queue", + { + index: `${1}`, + title: player.queue.current.title, + duration: formatDuration(player.queue.current.length), + request: `${player.queue.current.requester}`, + }, + )}`; + await songStrings.push(...queuedSongs); + await songStrings.unshift(current_song); + const Str = songStrings.slice(0, 10).join("\n"); const TotalDuration = QueueDuration(player); diff --git a/src/languages/en/interaction.yaml b/src/languages/en/interaction.yaml index 8e676c3..df87a6f 100644 --- a/src/languages/en/interaction.yaml +++ b/src/languages/en/interaction.yaml @@ -4,7 +4,7 @@ dev_only: The bot is under maintenance. (Please come back again later) # No permission to use command (this for bot!) -no_perms: I don't have perms to execute command! +no_perms: "I don't have perms to execute command! [%{perm}]" # Bot getting error something! error: Something went wrong.