Skip to content

Commit

Permalink
fix: seasonal-calculator working after season ends
Browse files Browse the repository at this point in the history
  • Loading branch information
imnaiyar committed Jul 2, 2024
1 parent ee1f43b commit 56664ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/commands/slash/utility/calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export default {
await interaction.deferReply({
ephemeral: interaction.options.getBoolean("hide") ?? false,
});
const hasPass = interaction.options.getBoolean("season-pass")!;
const candles = interaction.options.getInteger("candles")!;
const dailies = interaction.options.getBoolean("dailies")!;
const hasPass = interaction.options.getBoolean("season-pass");
const candles = interaction.options.getInteger("candles", true);
const dailies = interaction.options.getBoolean("dailies", true);
const now = moment().tz(client.timezone);
const end = moment.tz(sn.end, "MM-DD-YYYY", client.timezone);
const end = moment.tz(sn.end, "DD-MM-YYYY", client.timezone);
// prettier-ignore
if (now.isAfter(end)) return void await interaction.followUp(t("commands.SEASONAL_CALCULATOR.RESPONSES.NOT_ACTIVE"));
const userData = await client.database.getUserData(interaction.user);
if (hasPass !== undefined) {
if (hasPass) {
userData.hasPass = hasPass;
await userData.save();
}
Expand Down

0 comments on commit 56664ee

Please sign in to comment.