feat!: Sharding implemented across the bot

This commit is contained in:
Marius Begby committed 2023-07-21 14:17:04 +02:00
1 parent b160cbf564
commit 9c15c636d9
29 files changed
+270 -142

No files matched your search

+7 -5
View File
@@ -12,7 +12,9 @@ module.exports = {
const command = client.commands.get(interaction.commandName);
if (!command) {
logger.warn(`Interaction created but command '${interaction.commandName}' was not found.`);
logger.warn(
`[Shard ${interaction.guild.shardId}] Interaction created but command '${interaction.commandName}' was not found.`
);
return;
}
@@ -32,13 +34,13 @@ module.exports = {
executionTime > 55000
) {
logger.info(
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' executed in ${executionTime} ms.`
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' executed in ${executionTime} ms.`
);
return;
}
logger.warn(
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' took ${executionTime} ms to execute.`
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' took ${executionTime} ms to execute.`
);
return await interaction.followUp({
@@ -54,13 +56,13 @@ module.exports = {
});
} else {
logger.info(
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' executed in ${executionTime} ms.`
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' executed in ${executionTime} ms.`
);
}
} catch (error) {
logger.error(
error,
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' failed to execute.`
`[Shard ${interaction.guild.shardId}] Guild ${interaction.guild.id}> Command '${interaction}' failed to execute.`
);
await interaction.followUp({