From 342a48d58c93bee846ad915ae2dbd55f9534ecd4 Mon Sep 17 00:00:00 2001 From: Vachan MN Date: Tue, 22 Feb 2022 11:03:35 +0530 Subject: [PATCH 1/3] Delete ban.js --- commands/moderation/ban.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 commands/moderation/ban.js diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js deleted file mode 100644 index 8d77f21..0000000 --- a/commands/moderation/ban.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - name: "ban", - description: "Ban the user", - category: "moderation", - usage: "ban ", - guildOnly: true, - /** - * @description Executes when the command is called by command handler. - * @author Vachan MN - * @param {Object} message The Message Object of the command. - * @param {String[]} args The Message Content of the received message seperated by spaces (' ') in an array, this excludes prefix and command/alias itself. - */ - - execute(message, args) { - // Check if the user has the permission to ban. - if (!message.member.hasPermission("BAN_MEMBERS")) { - return message.channel.send( - `${message.author} You don't have permission to ban members.` - ); - } - // Ban the user mentioned - if (message.mentions.users.size) { - const user = message.mentions.users.first(); - message.guild.member(user).ban(); - message.channel.send(`${message.author} Banned ${user}`); - } else { - message.channel.send(`${message.author} You need to mention a user to ban.`); - } - - }, -}; From eb8006746b297d3e073803ae8a6e093c76be1cac Mon Sep 17 00:00:00 2001 From: Vachan MN Date: Tue, 22 Feb 2022 11:05:04 +0530 Subject: [PATCH 2/3] Update repeat.js --- commands/music/repeat.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/music/repeat.js b/commands/music/repeat.js index 09bb150..a16e0f0 100644 --- a/commands/music/repeat.js +++ b/commands/music/repeat.js @@ -19,6 +19,7 @@ module.exports = { const queue = client.distube.getQueue(message) if (!queue) return message.channel.send(`There is nothing playing!`) let mode = null + if (!args[0]) return await message.reply("Please use the command properly, use the help command"); switch (args[0]) { case "off": mode = 0 From 807b04d510e139d90274684d1b10c6994da0a06e Mon Sep 17 00:00:00 2001 From: Vachan MN Date: Tue, 22 Feb 2022 11:19:23 +0530 Subject: [PATCH 3/3] protect against embed char limits fixes https://github.com/vachanmn123/IvyBot/issues/3 --- commands/music/queue.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/music/queue.js b/commands/music/queue.js index d8d1438..9ae8dc6 100644 --- a/commands/music/queue.js +++ b/commands/music/queue.js @@ -16,7 +16,8 @@ module.exports = { execute(message, args) { const queue = message.client.distube.getQueue(message) if (!queue) return message.channel.send(`There is nothing playing!`) - const q = queue.songs.map((song, i) => `${i === 0 ? "Playing:" : `${i}.`} ${song.name} - \`${song.formattedDuration}\``).join("\n") + let q = queue.songs.map((song, i) => `${i === 0 ? "Playing:" : `${i}.`} ${song.name} - \`${song.formattedDuration}\``).join("\n") + if (q.length >= 1020) q = `${q.slice(0, 1020)}...` const embed = new MessageEmbed() .setColor("#101010") .setTitle("Queue")