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

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

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

revision 124 by rakin, Mon Jul 29 17:28:41 2024 UTC revision 153 by rakin, Mon Jul 29 17:28:48 2024 UTC
# Line 10  import getMember from '../../utils/getMe Line 10  import getMember from '../../utils/getMe
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';
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 {
# Line 233  export default class MuteCommand extends Line 234  export default class MuteCommand extends
234              dateTime = Date.now() + timeInterval;              dateTime = Date.now() + timeInterval;
235          }          }
236    
237            if (shouldNotModerate(client, user)) {
238                await msg.reply({
239                    embeds: [
240                        {
241                            description: "This user cannot be muted."
242                        }
243                    ]
244                });
245    
246                return;
247            }
248            
249          await mute(client, dateTime, user, msg, timeInterval, reason, hard);          await mute(client, dateTime, user, msg, timeInterval, reason, hard);
250    
251          const fields = [          const fields = [
# Line 268  export default class MuteCommand extends Line 281  export default class MuteCommand extends
281              ]              ]
282          });          });
283      }      }
 }  
284    }

Legend:
Removed from v.124  
changed lines
  Added in v.153

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26