/[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 336 by rakin, Mon Jul 29 17:29:36 2024 UTC revision 344 by rakin, Mon Jul 29 17:29:40 2024 UTC
# Line 1  Line 1 
1  import { BanOptions, CommandInteraction, Guild, GuildMember, Interaction, Message, Permissions, User } from 'discord.js';  import { CommandInteraction, GuildMember, 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';
5  import InteractionOptions from '../../types/InteractionOptions';  import InteractionOptions from '../../types/InteractionOptions';
6  import MessageEmbed from '../../client/MessageEmbed';  import MessageEmbed from '../../client/MessageEmbed';
 import getUser from '../../utils/getUser';  
 import History from '../../automod/History';  
7  import getMember from '../../utils/getMember';  import getMember from '../../utils/getMember';
 import ms from 'ms';  
8    
9  import PunishmentType from '../../types/PunishmentType';  import PunishmentType from '../../types/PunishmentType';
10    
11  export async function unmute(client: DiscordClient, user: GuildMember, d: User) {  export async function unmute(client: DiscordClient, user: GuildMember, d: User) {
12      try {                  try {            
         await History.create(user.id, user.guild!, 'unmute', d.id, null);  
   
13          const role = await user.guild!.roles.fetch(client.config.props[user.guild.id].mute_role);          const role = await user.guild!.roles.fetch(client.config.props[user.guild.id].mute_role);
14          try {          try {
15              await user.roles.remove(role!, 'Unmuting user');              await user.roles.remove(role!, 'Unmuting user');

Legend:
Removed from v.336  
changed lines
  Added in v.344

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26