Skip to content

Commit

Permalink
fix: remindme max time
Browse files Browse the repository at this point in the history
  • Loading branch information
N3aar committed Jul 3, 2024
1 parent e9561aa commit a89489c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/user/remindme.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { maxTimeInSeconds } from "@/utils/contants.js";
import { Command } from "@sapphire/framework";
import type { GuildMember, TextChannel } from "discord.js";

Expand All @@ -14,7 +15,7 @@ export class RemindMeCommand extends Command {
.addNumberOption((option) => {
option.setName("minutes");
option.setDescription("Tempo em minutos");
option.setMaxValue(60);
option.setMaxValue(maxTimeInSeconds);
option.setMinValue(1);
option.setRequired(false);
return option;
Expand All @@ -34,7 +35,7 @@ export class RemindMeCommand extends Command {
if (!member || !interaction.channel) return;

const time = interaction.options.getNumber("minutes") || 15;
const minutes = Math.max(Math.min(time, 180), 1);
const minutes = Math.max(Math.min(time, maxTimeInSeconds), 1);

const ms = minutes * 60000;
const message =
Expand Down
2 changes: 2 additions & 0 deletions src/utils/contants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const embedColors = {

export const adminPermission = 8;

export const maxTimeInSeconds = 180;

export const defaultTimeZone = "America/Sao_Paulo";

export const leaderboardIcon = "https://i.imgur.com/qpb2q9S.png";
Expand Down

0 comments on commit a89489c

Please sign in to comment.