mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #14 from mariusbegby/bug-fixes-and-changes
Bug fixes and changes
This commit is contained in:
4 files changed
+41
-9
No files matched your search
@@ -17,18 +17,18 @@
|
|||||||
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&label=Support%20Server&labelColor=1b1c1d&logo=discord&logoColor=white&color=4c73df" alt="Cadence Discord support server"></a>
|
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&label=Support%20Server&labelColor=1b1c1d&logo=discord&logoColor=white&color=4c73df" alt="Cadence Discord support server"></a>
|
||||||
<a href="https://github.com/mariusbegby/cadence-discord-bot/releases">
|
<a href="https://github.com/mariusbegby/cadence-discord-bot/releases">
|
||||||
<img src="https://img.shields.io/github/package-json/v/mariusbegby/cadence-discord-bot/main?style=for-the-badge&label=Version&labelColor=1b1c1d&logo=github&logoColor=white&color=4c73df" alt="Cadence bot release"></a>
|
<img src="https://img.shields.io/github/package-json/v/mariusbegby/cadence-discord-bot/main?style=for-the-badge&label=Version&labelColor=1b1c1d&logo=github&logoColor=white&color=4c73df" alt="Cadence bot release"></a>
|
||||||
<a href="https://github.com/mariusbegby/cadence-discord-bot/releases">
|
<a href="https://github.com/mariusbegby/cadence-discord-bot/blob/main/LICENSE.md">
|
||||||
<img src="https://img.shields.io/github/license/mariusbegby/cadence-discord-bot?style=for-the-badge&label=License&labelColor=1b1c1d&logo=github&logoColor=white&color=4c73df" alt="Cadence bot release">
|
<img src="https://img.shields.io/github/license/mariusbegby/cadence-discord-bot?style=for-the-badge&label=License&labelColor=1b1c1d&logo=github&logoColor=white&color=4c73df" alt="Cadence bot license">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## 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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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).
|
||||||
@@ -75,6 +75,18 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
const skippedTrack = queue.currentTrack;
|
||||||
queue.node.skip();
|
queue.node.skip();
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,18 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
const executionTime = outputTime - inputTime;
|
const executionTime = outputTime - inputTime;
|
||||||
|
|
||||||
if (executionTime > 20000) {
|
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(
|
console.log(
|
||||||
`${new Date().toISOString().substring(11, 19)}: Warning: ⚠️ ${
|
`${new Date().toISOString().substring(11, 19)}: Warning: ⚠️ ${
|
||||||
interaction.guild.name
|
interaction.guild.name
|
||||||
|
|||||||
@@ -31,18 +31,22 @@ module.exports = {
|
|||||||
return {
|
return {
|
||||||
name: guild.name,
|
name: guild.name,
|
||||||
memberCount: guild.memberCount
|
memberCount: guild.memberCount
|
||||||
}
|
};
|
||||||
})
|
})
|
||||||
.sort((a, b) => b.memberCount - a.memberCount)
|
.sort((a, b) => b.memberCount - a.memberCount)
|
||||||
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
|
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
|
||||||
.join(', ');
|
.join(', ');
|
||||||
|
|
||||||
|
let embedDescription = `**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`;
|
||||||
|
|
||||||
|
if (embedDescription.length >= 4000) {
|
||||||
|
embedDescription = `${embedDescription.slice(0, 3996)}...`;
|
||||||
|
}
|
||||||
|
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(embedDescription)
|
||||||
`**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`
|
|
||||||
)
|
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user