From 4f8fc1e53cbdfbe14a4b1b7254abbbda776b03b1 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 9 Jul 2023 20:45:15 +0200 Subject: [PATCH 1/5] fix: Updated link to MIT license in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f24b642..fd8be57 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Cadence Discord support server  Cadence bot release  - - Cadence bot release + + Cadence bot license

From 81a741541979f899745fbb38bd446305a7c61f33 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 9 Jul 2023 21:00:46 +0200 Subject: [PATCH 2/5] fix: Update README with credits to discord.js and discord-player --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fd8be57..4b2d04b 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@

-## Adding the bot +## Adding the bot 🤖 To add the bot to your Discord server, click [here](https://discord.com/oauth2/authorize?client_id=1125742835946237992&permissions=0&scope=bot%20applications.commands). This will invite the bot to your Discord server. Once the bot has joined your Discord server, there is no additional configuration. Execute the `/help` command to view a list of commands to use. -## Hosting the bot yourself +## Hosting the bot yourself 🔓 This bot is open-source, and if you want to host it yourself, you can do so by following the steps below. @@ -39,6 +39,10 @@ This bot is open-source, and if you want to host it yourself, you can do so by f 5. Deploy slash commands via Discord API by running `npm run deploy`. This is required to make the commands accessible for Discord servers. 6. Run `npm start` to start the bot. If everything is configured and setup correctly, the bot should be online and ready to use. You will need to invite the bot to a server, see [Adding your bot to servers](https://discordjs.guide/preparations/adding-your-bot-to-servers.html#bot-invite-links) article for help. -## Get help and support +## Get help and support 🛟 If you experience any issues, please open an issue on this repository or join the [Discord support server](https://discord.gg/t6Bm8wPpXB) for the Cadence bot. + +## Credits and acknowledgments 🎉 + +This project is made possible by using [discord.js](https://github.com/discordjs/discord.js/) and [discord-player](https://github.com/Androz2091/discord-player). From 6e68fe604b0e904f3adfbf5277a62758ab5e8969 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 9 Jul 2023 21:53:01 +0200 Subject: [PATCH 3/5] Don't send execution time warning for /filters command above 55 seconds --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index 952cf1e..8f90e7b 100644 --- a/index.js +++ b/index.js @@ -127,6 +127,18 @@ client.on('interactionCreate', async (interaction) => { const executionTime = outputTime - inputTime; if (executionTime > 20000) { + // don't send warning message for filters command, as collector timeout happens after 60 seconds + if (command.name === 'filters' && executionTime > 55000) { + console.log( + `${new Date().toISOString().substring(11, 19)}: Info: ${ + interaction.guild.name + } (#${ + interaction.guild.memberCount + })> Command '${interaction}' executed in ${executionTime} ms.` + ); + return; + } + console.log( `${new Date().toISOString().substring(11, 19)}: Warning: ⚠️ ${ interaction.guild.name From 8c7d4a07cacc8556f197f7e56eeef354736765ac Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Mon, 10 Jul 2023 00:26:33 +0200 Subject: [PATCH 4/5] fix: Cut /guilds command message reply length to 4000 characters --- system-commands/guilds.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/system-commands/guilds.js b/system-commands/guilds.js index 72847ca..15b91a0 100644 --- a/system-commands/guilds.js +++ b/system-commands/guilds.js @@ -31,18 +31,22 @@ module.exports = { return { name: guild.name, memberCount: guild.memberCount - } + }; }) .sort((a, b) => b.memberCount - a.memberCount) .map((guild) => `\`${guild.name} (#${guild.memberCount})\``) .join(', '); + let embedDescription = `**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`; + + if (embedDescription.length >= 4000) { + embedDescription = `${embedDescription.slice(0, 3996)}...`; + } + return await interaction.editReply({ embeds: [ new EmbedBuilder() - .setDescription( - `**Guilds (${client.guilds.cache.size} total)**\n${guildsList}` - ) + .setDescription(embedDescription) .setColor(embedColors.colorInfo) ] }); From 77c91a350f4c5b1336c7917a24ac9e9b3fc4ad66 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Mon, 10 Jul 2023 00:29:01 +0200 Subject: [PATCH 5/5] fix: trying to read title on track for initialized but empty queue --- commands/skip.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commands/skip.js b/commands/skip.js index 57bf0cc..7526f30 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -75,6 +75,18 @@ module.exports = { }); } } else { + if (queue.tracks.data.length === 0 && !queue.currentTrack) { + return await interaction.editReply({ + embeds: [ + new EmbedBuilder() + .setDescription( + `**Failed**\nThere are no tracks in the queue and nothing currently playing.` + ) + .setColor(embedColors.colorWarning) + ] + }); + } + const skippedTrack = queue.currentTrack; queue.node.skip();