mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 16:53:57 +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 { SlashCommandBuilder } from 'discord.js'
|
||||||
|
|
||||||
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
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 type { Command } from '../types'
|
||||||
|
|
||||||
import { config } from '$/context'
|
import { config } from '$/context'
|
||||||
@@ -60,6 +60,10 @@ export default {
|
|||||||
createModerationActionEmbed('Muted', user, interaction.user, reason, durationMs),
|
createModerationActionEmbed('Muted', user, interaction.user, reason, durationMs),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (durationMs) setTimeout(() => {
|
||||||
|
removeRolePreset(member, 'mute')
|
||||||
|
}, durationMs)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`Moderator ${interaction.user.tag} (${interaction.user.id}) muted ${user.tag} (${user.id}) until ${expires} because ${reason}`,
|
`Moderator ${interaction.user.tag} (${interaction.user.id}) muted ${user.tag} (${user.id}) until ${expires} because ${reason}`,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user