mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(bots/discord): set timeout for eligible mutes to unmute faster
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { SlashCommandBuilder } from 'discord.js'
|
||||
|
||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
||||
import { applyRolePreset } from '$/utils/discord/rolePresets'
|
||||
import { applyRolePreset, removeRolePreset } from '$/utils/discord/rolePresets'
|
||||
import type { Command } from '../types'
|
||||
|
||||
import { config } from '$/context'
|
||||
@@ -60,6 +60,10 @@ export default {
|
||||
createModerationActionEmbed('Muted', user, interaction.user, reason, durationMs),
|
||||
)
|
||||
|
||||
if (durationMs) setTimeout(() => {
|
||||
removeRolePreset(member, 'mute')
|
||||
}, durationMs)
|
||||
|
||||
logger.info(
|
||||
`Moderator ${interaction.user.tag} (${interaction.user.id}) muted ${user.tag} (${user.id}) until ${expires} because ${reason}`,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user