mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 22:15:29 +00:00
fix: changed position of guild member count in log calls
This commit is contained in:
1 parent
6bb602ebbb
commit
3c345cf14c
1 file changed
+7
-4
@@ -127,15 +127,18 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
// don't send warning message for filters command, as collector timeout happens after 60 seconds
|
// don't send warning message for filters command, as collector timeout happens after 60 seconds
|
||||||
if (command.name === 'filters' && executionTime > 55000) {
|
if (command.name === 'filters' && executionTime > 55000) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`${interaction.guild.name} (${interaction.guild.memberCount})> Command '${interaction}' executed in ${executionTime} ms.`
|
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' executed in ${executionTime} ms.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`${interaction.guild.name} (${interaction.guild.memberCount})> Command '${interaction}' took ${executionTime} ms to execute.`
|
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' took ${executionTime} ms to execute.`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// todo: using interaction.editReply() might lead to "unknown interaction" error
|
||||||
|
// it might already have been replied to or deferred
|
||||||
|
// solution might be to use interaction.followUp() instead or send a message to the channel?
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -149,13 +152,13 @@ client.on('interactionCreate', async (interaction) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.info(
|
logger.info(
|
||||||
`${interaction.guild.name} (${interaction.guild.memberCount})> Command '${interaction}' executed in ${executionTime} ms.`
|
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' executed in ${executionTime} ms.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(
|
logger.error(
|
||||||
error,
|
error,
|
||||||
`${interaction.guild.name} (${interaction.guild.memberCount})> Command '${interaction}' failed to execute.`
|
`(${interaction.guild.memberCount}) ${interaction.guild.name}> Command '${interaction}' failed to execute.`
|
||||||
);
|
);
|
||||||
|
|
||||||
// todo: using interaction.editReply() might lead to "unknown interaction" error
|
// todo: using interaction.editReply() might lead to "unknown interaction" error
|
||||||
|
|||||||
Reference in new issue
Block a user