From 0c1382c55856ed1e54c9e53dbb37e9297c5da37c Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Wed, 16 Apr 2025 20:35:37 +0700 Subject: [PATCH] fix(bots/discord/commands/moderation): check if timeout amount is safe in role-preset commands --- bots/discord/src/commands/moderation/mute.ts | 2 +- bots/discord/src/commands/moderation/role-preset.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/src/commands/moderation/mute.ts b/bots/discord/src/commands/moderation/mute.ts index 1e34236..1032a21 100644 --- a/bots/discord/src/commands/moderation/mute.ts +++ b/bots/discord/src/commands/moderation/mute.ts @@ -63,7 +63,7 @@ export default new ModerationCommand({ createModerationActionEmbed('Muted', user, executor.user, reason, Math.ceil(expires / 1000)), ) - if (duration) + if (Number.isSafeInteger(expires)) setTimeout(() => { removeRolePreset(member, 'mute') }, duration) diff --git a/bots/discord/src/commands/moderation/role-preset.ts b/bots/discord/src/commands/moderation/role-preset.ts index 9e9f689..04f3038 100644 --- a/bots/discord/src/commands/moderation/role-preset.ts +++ b/bots/discord/src/commands/moderation/role-preset.ts @@ -78,7 +78,7 @@ export default new ModerationCommand({ ) } - if (expires) + if (Number.isSafeInteger(expires)) setTimeout(() => { removeRolePreset(member, preset) }, expires)