From 7a259c616081a99ef8af3456a282b13c6738b059 Mon Sep 17 00:00:00 2001 From: Sudhan <55418697+SudhanPlayz@users.noreply.github.com> Date: Thu, 6 May 2021 11:55:40 +0530 Subject: [PATCH] Development (#187) * Development (#183) * Update index.js (#178) * Handle error LavaLink not connect (#180) * Delete .replit * Handle error node not connect .. * Handle error lavalink not connect * Create .replit * Master branch to development (#171) * Latest commits to fix stuff (#169) * 24/7 Stay in vc stuff * edits and fixes (#168) Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * ;-; (#170) * 24/7 Stay in vc stuff * edits and fixes (#168) * add: YouTube Tutorial at readme Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * edits and some fixes, but not all * split loop and loopqueue to make it simpler * Fixed single Spotify track "no matches" error * Small edits Co-authored-by: A cute Blob <77403361+A-cute-blob@users.noreply.github.com> Co-authored-by: ColonelOU <67454598+Colonel-Ltd@users.noreply.github.com> Co-authored-by: Sudhan <55418697+SudhanPlayz@users.noreply.github.com> * Development (#186) * Master branch to development (#171) * Latest commits to fix stuff (#169) * 24/7 Stay in vc stuff * edits and fixes (#168) Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * ;-; (#170) * 24/7 Stay in vc stuff * edits and fixes (#168) * add: YouTube Tutorial at readme Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * edits and some fixes, but not all * split loop and loopqueue to make it simpler * Fixed single Spotify track "no matches" error * Small edits * Fix 'Searching' has already been declared * Development (#183) (#184) * Update index.js (#178) * Handle error LavaLink not connect (#180) * Delete .replit * Handle error node not connect .. * Handle error lavalink not connect * Create .replit * Master branch to development (#171) * Latest commits to fix stuff (#169) * 24/7 Stay in vc stuff * edits and fixes (#168) Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * ;-; (#170) * 24/7 Stay in vc stuff * edits and fixes (#168) * add: YouTube Tutorial at readme Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> * edits and some fixes, but not all * split loop and loopqueue to make it simpler * Fixed single Spotify track "no matches" error * Small edits Co-authored-by: A cute Blob <77403361+A-cute-blob@users.noreply.github.com> Co-authored-by: ColonelOU <67454598+Colonel-Ltd@users.noreply.github.com> Co-authored-by: Sudhan <55418697+SudhanPlayz@users.noreply.github.com> Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> Co-authored-by: A cute Blob <77403361+A-cute-blob@users.noreply.github.com> Co-authored-by: ColonelOU <67454598+Colonel-Ltd@users.noreply.github.com> * Update play.js (#185) When the bot is kicked out of the room while the song is playing, the play command did not bring the bot into the room, it only adds the song added with the play command to the queue and the bot did not come to the room. (When the bot is thrown with the change made, it will be able to come to the room with the play command) * Slash command fixes * edits * Update grab.js * Update loop.js Co-authored-by: Sudhan <55418697+SudhanPlayz@users.noreply.github.com> Co-authored-by: ColonelOU <67454598+Colonel-Ltd@users.noreply.github.com> Co-authored-by: A cute Blob <77403361+A-cute-blob@users.noreply.github.com> Co-authored-by: yekaranfil <77460386+yekaranfil@users.noreply.github.com> Co-authored-by: Joseph <71621973+joeyk710@users.noreply.github.com> Co-authored-by: A cute Blob <77403361+A-cute-blob@users.noreply.github.com> Co-authored-by: ColonelOU <67454598+Colonel-Ltd@users.noreply.github.com> Co-authored-by: yekaranfil <77460386+yekaranfil@users.noreply.github.com> --- commands/bassboost.js | 4 ++-- commands/grab.js | 14 ++++++++------ commands/loop.js | 6 +++--- commands/loopqueue.js | 2 +- commands/pause.js | 2 +- commands/remove.js | 2 +- commands/resume.js | 2 +- commands/seek.js | 1 + commands/shuffle.js | 1 + commands/skip.js | 1 + commands/skipto.js | 2 +- commands/volume.js | 1 + 12 files changed, 22 insertions(+), 16 deletions(-) diff --git a/commands/bassboost.js b/commands/bassboost.js index ec12cc8e1..6375e9631 100644 --- a/commands/bassboost.js +++ b/commands/bassboost.js @@ -26,8 +26,8 @@ module.exports = { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); - else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); + //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (!args[0]) return client.sendTime(message.channel, "**Please provide a bassboost level. \nAvailable Levels:** `none`, `low`, `medium`, `high`"); //if the user do not provide args [arguments] diff --git a/commands/grab.js b/commands/grab.js index 7963d98bf..160912e80 100644 --- a/commands/grab.js +++ b/commands/grab.js @@ -20,6 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); message.author.send(new MessageEmbed() .setAuthor(`Saved Song:`, client.user.displayAvatarURL({ dynamic: true @@ -40,7 +41,7 @@ run: async (client, message, args, { GuildDB }) => { return message.channel.send("**:x: Your Dm's are disabled**") }) - message.react("✅").catch(e=>console.log("Could not react")) + client.sendTime(message.channel, "✅ | **Check your DMs!**") }, SlashCommand: { /** @@ -51,11 +52,12 @@ run: async (client, message, args, { GuildDB }) => { * @param {*} param3 */ run: async (client, interaction, args, { GuildDB }) => { + const user = client.users.cache.get(interaction.member.user.id); let player = await client.Manager.get(interaction.guild_id); if (!player) return client.sendTime(interaction, "❌ | **Nothing is playing right now...**"); try{ let embed = new MessageEmbed() - .setAuthor(`Saved from `, interaction.guild.name, client.user.displayAvatarURL()) + .setAuthor(`Saved Song: `, client.user.displayAvatarURL()) .setThumbnail(`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`) .setURL(player.queue.current.uri) .setColor("RANDOM") @@ -66,15 +68,15 @@ run: async (client, message, args, { GuildDB }) => { .addField(`▶ Play it:`, `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix }play ${player.queue.current.uri}\``) .addField(`🔎 Saved in:`, `<#${interaction.channel_id}>`) - .setFooter(`Requested by: ${player.queue.current.requester.tag} | Guild: ${interaction.guild.name}`, player.queue.current.requester.displayAvatarURL({ + .setFooter(`Requested by: ${player.queue.current.requester.tag}`, player.queue.current.requester.displayAvatarURL({ dynamic: true })) - interaction.send(embed); + user.send(embed); }catch(e) { - return client.sendTime(interaction, "**:x: Your DM's are disabled**") + return client.sendTime(interaction, "**:x: Your DMs are disabled**") } - interaction.react("✅").catch(e => console.log("Could not react")) + client.sendTime(interaction, "✅ | **Check your DMs!**") }, }, }; \ No newline at end of file diff --git a/commands/loop.js b/commands/loop.js index 5844196e3..52eaed80e 100644 --- a/commands/loop.js +++ b/commands/loop.js @@ -20,7 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (player.trackRepeat) { @@ -45,8 +45,8 @@ module.exports = { const voiceChannel = member.voice.channel; let player = await client.Manager.get(interaction.guild_id); if (!player) return client.sendTime(interaction, "❌ | **Nothing is playing right now...**"); - if (!member.voice.channel) return interaction.send("❌ | You must be on a voice channel."); - if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return interaction.send(`❌ | You must be on ${guild.me.voice.channel} to use this command.`); + if (!member.voice.channel) return interaction.send("❌ | **You must be in a voice channel to use this command!**"); + if (guild.me.voice.channel && !guild.me.voice.channel.equals(voiceChannel)) return interaction.send(`❌ | You must be in ${guild.me.voice.channel} to use this command.`); if(player.trackRepeat){ player.setTrackRepeat(false) diff --git a/commands/loopqueue.js b/commands/loopqueue.js index d5cdcc82b..631ce54a0 100644 --- a/commands/loopqueue.js +++ b/commands/loopqueue.js @@ -20,7 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (player.QueueRepeat) { diff --git a/commands/pause.js b/commands/pause.js index 0e60ee711..8aca8024d 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -20,7 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (player.paused) return client.sendTime(message.channel, "❌ | **Music is already paused!**"); player.pause(true); diff --git a/commands/remove.js b/commands/remove.js index cf044390d..7ac5e538a 100644 --- a/commands/remove.js +++ b/commands/remove.js @@ -22,7 +22,7 @@ const { TrackUtils } = require("erela.js"); let player = await client.Manager.players.get(message.guild.id); const song = player.queue.slice(args[0] - 1, 1); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (!player.queue || !player.queue.length || player.queue.length === 0) diff --git a/commands/resume.js b/commands/resume.js index ab73bab10..62a9c2a3a 100644 --- a/commands/resume.js +++ b/commands/resume.js @@ -20,7 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); if (player.playing) return message.channel.send("Music is already resumed!"); diff --git a/commands/seek.js b/commands/seek.js index 483c30cc7..1fb8ae795 100644 --- a/commands/seek.js +++ b/commands/seek.js @@ -20,6 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); if (!player.queue.current.isSeekable) return message.channel.send("This song is not able to seek from."); let SeekTo = client.ParseHumanTime(args.join(" ")); if (!SeekTo) return message.channel.send("Please enter a time to seek!"); diff --git a/commands/shuffle.js b/commands/shuffle.js index d7ae47b91..aa5e1d88b 100644 --- a/commands/shuffle.js +++ b/commands/shuffle.js @@ -19,6 +19,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); if (!player.queue || !player.queue.length || player.queue.length === 0) return message.channel.send("Not enough songs in the queue to shuffle!"); player.queue.shuffle(); diff --git a/commands/skip.js b/commands/skip.js index 1de419d03..e07ee0541 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -20,6 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); player.stop(); await message.react("✅"); }, diff --git a/commands/skipto.js b/commands/skipto.js index fddb155f8..0904b9456 100644 --- a/commands/skipto.js +++ b/commands/skipto.js @@ -27,7 +27,7 @@ module.exports = { }); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); - if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); //else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`); try { diff --git a/commands/volume.js b/commands/volume.js index 4daf46eaa..c65498456 100644 --- a/commands/volume.js +++ b/commands/volume.js @@ -20,6 +20,7 @@ module.exports = { run: async (client, message, args, { GuildDB }) => { let player = await client.Manager.get(message.guild.id); if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**"); + if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to use this command!**"); if (!parseInt(args[0])) return message.channel.send("Please choose between 1 - 100"); let vol = parseInt(args[0]); player.setVolume(vol);