Drop: Fix cooldown formatting (fixes #15)

Formatted cooldown strings are now properly pluralized
trimmed for zero values and also include seconds.
This commit is contained in:
Minz committed 2022-09-21 11:51:58 +02:00
1 parent f0a0bef7e9
commit 4d97215891
2 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ module.exports = {
const cooldowns = await UserUtils.getCooldowns(user);
if (cooldowns.dropCooldown > 0 && permissionLevel < 2) {
interaction.editReply({
content: `You can drop more cards in ${Math.floor((cooldowns.dropCooldown % 3600000) / 60000)} minutes`,
content: `You can't drop a card yet! ${cooldowns.dropCooldownFormatted}`,
ephemeral: false
});
return;
@@ -108,7 +108,7 @@ module.exports = {
let permissionLevel = await UserUtils.getPermissionLevel(i.member);
if (cooldowns.pullCooldown > 0 && permissionLevel < 2) {
i.reply({
content: `You can claim more cards in ${Math.floor((cooldowns.pullCooldown % 3600000) / 60000)} minutes`,
content: `You can't claim a card yet! ${cooldowns.pullCooldownFormatted}`,
ephemeral: false
});
return;