/[sudobot]/trunk/src/commands/moderation/UnmuteCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/moderation/UnmuteCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 51 by rakin, Mon Jul 29 17:28:23 2024 UTC revision 86 by rakin, Mon Jul 29 17:28:32 2024 UTC
# Line 9  import History from '../../automod/Histo Line 9  import History from '../../automod/Histo
9  import getMember from '../../utils/getMember';  import getMember from '../../utils/getMember';
10  import ms from 'ms';  import ms from 'ms';
11    
12    import PunishmentType from '../../types/PunishmentType';
13    
14  export async function unmute(client: DiscordClient, user: GuildMember, msg: Message | CommandInteraction, d: User) {  export async function unmute(client: DiscordClient, user: GuildMember, msg: Message | CommandInteraction, d: User) {
15      try {                  try {            
16          await History.create(user.id, msg.guild!, 'unmute', msg.member!.user.id, null);          await History.create(user.id, msg.guild!, 'unmute', msg.member!.user.id, null);
# Line 16  export async function unmute(client: Dis Line 18  export async function unmute(client: Dis
18          const role = await msg.guild!.roles.fetch(client.config.get('mute_role'));          const role = await msg.guild!.roles.fetch(client.config.get('mute_role'));
19          await user.roles.remove(role!);          await user.roles.remove(role!);
20    
21            const { default: Punishment } = await import('../../models/Punishment');
22    
23            await Punishment.create({
24                type: PunishmentType.UNMUTE,
25                user_id: user.id,
26                guild_id: msg.guild!.id,
27                mod_id: d.id,
28                mod_tag: d.tag,
29            });
30    
31          await user.send({          await user.send({
32              embeds: [              embeds: [
33                  new MessageEmbed()                  new MessageEmbed()

Legend:
Removed from v.51  
changed lines
  Added in v.86

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26