Cooldowns: Add support for new Patreon multi drops/pickups

Also include <t:> timestamp for Daily reset date
This commit is contained in:
2023-03-13 03:31:20 +01:00
parent da78623a05
commit 147cb1553d

View File

@@ -13,14 +13,25 @@ module.exports = {
const user = await UserUtils.getUserByDiscordId(interaction.member.id); const user = await UserUtils.getUserByDiscordId(interaction.member.id);
//get user cooldowns using user utils //get user cooldowns using user utils
const cooldowns = await UserUtils.getCooldowns(user); const cooldowns = await UserUtils.getCooldowns(user, (await UserUtils.getPatreonPerks(interaction.client, user))['tier']);
let reply = "Cooldowns:\n"; let reply = "Cooldowns:\n";
for (cooldown in cooldowns) { if (cooldowns.remainingDrops > 0) {
//if cooldown contains the string formatted reply += `Drop: ${cooldowns.remainingDrops} remaining\n`;
if (cooldown.includes("Formatted")) { } else {
reply += `${cooldowns[cooldown]}\n`; reply += `Drop: Resets in ${cooldowns.nextDropResetFormatted}\n`;
} }
if (cooldowns.remainingClaims > 0) {
reply += `Claim: ${cooldowns.remainingClaims} remaining\n`;
} else {
reply += `Claim: Resets in ${cooldowns.nextClaimResetFormatted}\n`;
}
if (cooldowns.nextDaily > 0) {
reply += `Daily: ${cooldowns.nextDailyFormatted}\n`;
} else {
reply += `Daily: Ready!\n`;
} }
interaction.reply({ interaction.reply({