1 |
import { BanOptions, CommandInteraction, Guild, GuildMember, Interaction, Message, User } from 'discord.js'; |
import { BanOptions, CommandInteraction, Guild, GuildMember, Interaction, Message, Permissions, User } from 'discord.js'; |
2 |
import BaseCommand from '../../utils/structures/BaseCommand'; |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
import DiscordClient from '../../client/Client'; |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
import CommandOptions from '../../types/CommandOptions'; |
23 |
const { getTimeouts, clearTimeoutv2 } = await import('../../utils/setTimeout'); |
const { getTimeouts, clearTimeoutv2 } = await import('../../utils/setTimeout'); |
24 |
|
|
25 |
const { default: Hardmute } = await import("../../models/Hardmute"); |
const { default: Hardmute } = await import("../../models/Hardmute"); |
26 |
|
const { default: MuteRecord } = await import("../../models/MuteRecord"); |
27 |
|
|
28 |
const hardmute = await Hardmute.findOne({ |
const hardmute = await Hardmute.findOne({ |
29 |
where: { |
where: { |
79 |
mod_tag: d.tag, |
mod_tag: d.tag, |
80 |
}); |
}); |
81 |
|
|
82 |
|
const muteRecord = await MuteRecord.findOne({ |
83 |
|
where: { |
84 |
|
user_id: user.user.id, |
85 |
|
guild_id: user.guild.id |
86 |
|
} |
87 |
|
}); |
88 |
|
|
89 |
|
if (muteRecord) { |
90 |
|
await muteRecord.destroy(); |
91 |
|
} |
92 |
|
|
93 |
try { |
try { |
94 |
await user.send({ |
await user.send({ |
95 |
embeds: [ |
embeds: [ |
114 |
|
|
115 |
export default class UnmuteCommand extends BaseCommand { |
export default class UnmuteCommand extends BaseCommand { |
116 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
117 |
|
permissions = [Permissions.FLAGS.MODERATE_MEMBERS]; |
118 |
|
|
119 |
constructor() { |
constructor() { |
120 |
super('unmute', 'moderation', []); |
super('unmute', 'moderation', []); |