Skip to content

Commit

Permalink
feat: 🚸 make bonus commands set their time at midnights
Browse files Browse the repository at this point in the history
This fixes all bonus commands to have their cooldowns set at midnight
  • Loading branch information
VermiumSifell committed Jun 1, 2023
1 parent 27ae215 commit 96caf1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/commands/credits/groups/bonus/subcommands/daily/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addDays } from "date-fns";
import { addDays, startOfDay } from "date-fns";
import {
ChatInputCommandInteraction,
EmbedBuilder,
Expand Down Expand Up @@ -65,6 +65,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
addDays(new Date(), 1)
startOfDay(addDays(new Date(), 1))
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonths } from "date-fns";
import { addMonths, startOfDay } from "date-fns";
import {
ChatInputCommandInteraction,
EmbedBuilder,
Expand Down Expand Up @@ -71,6 +71,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
addMonths(new Date(), 1)
startOfDay(addMonths(new Date(), 1))
);
};
4 changes: 2 additions & 2 deletions src/commands/credits/groups/bonus/subcommands/weekly/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addWeeks } from "date-fns";
import { addWeeks, startOfDay } from "date-fns";
import {
ChatInputCommandInteraction,
EmbedBuilder,
Expand Down Expand Up @@ -67,6 +67,6 @@ export const execute = async (interaction: ChatInputCommandInteraction) => {
await generateCooldownName(interaction),
guild,
user,
addWeeks(new Date(), 1)
startOfDay(addWeeks(new Date(), 1))
);
};

0 comments on commit 96caf1d

Please sign in to comment.