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'; |
import { hasPermission, 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 { |
240 |
dateTime = Date.now() + timeInterval; |
dateTime = Date.now() + timeInterval; |
241 |
} |
} |
242 |
|
|
243 |
|
if (!(await hasPermission(client, user, msg, null, "You don't have permission to mute this user."))) { |
244 |
|
return; |
245 |
|
} |
246 |
|
|
247 |
if (shouldNotModerate(client, user)) { |
if (shouldNotModerate(client, user)) { |
248 |
await msg.reply({ |
await msg.reply({ |
249 |
embeds: [ |
embeds: [ |