fix(bots/discord/commands/moderation): check if timeout amount is safe in role-preset commands

This commit is contained in:
PalmDevs
2025-04-16 20:35:37 +07:00
parent 410d289297
commit 0c1382c558
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -78,7 +78,7 @@ export default new ModerationCommand({
)
}
if (expires)
if (Number.isSafeInteger(expires))
setTimeout(() => {
removeRolePreset(member, preset)
}, expires)