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 |
await user.send({ |
const muteRecord = await MuteRecord.findOne({ |
83 |
embeds: [ |
where: { |
84 |
new MessageEmbed() |
user_id: user.user.id, |
85 |
.setAuthor({ |
guild_id: user.guild.id |
86 |
iconURL: <string> user.guild!.iconURL(), |
} |
|
name: `\tYou have been unmuted in ${user.guild!.name}` |
|
|
}) |
|
|
] |
|
87 |
}); |
}); |
88 |
|
|
89 |
|
if (muteRecord) { |
90 |
|
await muteRecord.destroy(); |
91 |
|
} |
92 |
|
|
93 |
|
try { |
94 |
|
await user.send({ |
95 |
|
embeds: [ |
96 |
|
new MessageEmbed() |
97 |
|
.setAuthor({ |
98 |
|
iconURL: <string> user.guild!.iconURL(), |
99 |
|
name: `\tYou have been unmuted in ${user.guild!.name}` |
100 |
|
}) |
101 |
|
] |
102 |
|
}); |
103 |
|
} |
104 |
|
catch (e) { |
105 |
|
console.log(e); |
106 |
|
} |
107 |
|
|
108 |
await client.logger.logUnmute(user, d); |
await client.logger.logUnmute(user, d); |
109 |
} |
} |
110 |
catch (e) { |
catch (e) { |
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', []); |
197 |
] |
] |
198 |
}); |
}); |
199 |
} |
} |
|
} |
|
200 |
|
} |