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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user