10 |
import ms from 'ms'; |
import ms from 'ms'; |
11 |
import { unmute } from './UnmuteCommand'; |
import { unmute } from './UnmuteCommand'; |
12 |
import PunishmentType from '../../types/PunishmentType'; |
import PunishmentType from '../../types/PunishmentType'; |
13 |
|
import { shouldNotModerate } from '../../utils/util'; |
14 |
|
|
15 |
export async function mute(client: DiscordClient, dateTime: number | undefined, user: GuildMember, msg: Message | CommandInteraction, timeInterval: number | undefined, reason: string | undefined, hard: boolean = false) { |
export async function mute(client: DiscordClient, dateTime: number | undefined, user: GuildMember, msg: Message | CommandInteraction, timeInterval: number | undefined, reason: string | undefined, hard: boolean = false) { |
16 |
try { |
try { |
234 |
dateTime = Date.now() + timeInterval; |
dateTime = Date.now() + timeInterval; |
235 |
} |
} |
236 |
|
|
237 |
|
if (shouldNotModerate(client, user)) { |
238 |
|
await msg.reply({ |
239 |
|
embeds: [ |
240 |
|
{ |
241 |
|
description: "This user cannot be muted." |
242 |
|
} |
243 |
|
] |
244 |
|
}); |
245 |
|
|
246 |
|
return; |
247 |
|
} |
248 |
|
|
249 |
await mute(client, dateTime, user, msg, timeInterval, reason, hard); |
await mute(client, dateTime, user, msg, timeInterval, reason, hard); |
250 |
|
|
251 |
const fields = [ |
const fields = [ |
281 |
] |
] |
282 |
}); |
}); |
283 |
} |
} |
|
} |
|
284 |
|
} |