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

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

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

revision 106 by rakin, Mon Jul 29 17:28:37 2024 UTC revision 153 by rakin, Mon Jul 29 17:28:48 2024 UTC
# Line 11  import PunishmentType from '../../types/ Line 11  import PunishmentType from '../../types/
11  import { fetchEmojiStr } from '../../utils/Emoji';  import { fetchEmojiStr } from '../../utils/Emoji';
12  import ms from 'ms';  import ms from 'ms';
13  import { clearTimeoutv2, getTimeouts, setTimeoutv2 } from '../../utils/setTimeout';  import { clearTimeoutv2, getTimeouts, setTimeoutv2 } from '../../utils/setTimeout';
14    import { shouldNotModerate } from '../../utils/util';
15    
16  export default class tempBanCommand extends BaseCommand {  export default class tempBanCommand extends BaseCommand {
17      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 132  export default class tempBanCommand exte Line 133  export default class tempBanCommand exte
133          time = ms(time);          time = ms(time);
134            
135          try {          try {
136                try {
137                    const member = await msg.guild?.members.fetch(user.id);
138    
139                    if (member && shouldNotModerate(client, member)) {
140                        await msg.reply({
141                            embeds: [
142                                new MessageEmbed()
143                                .setColor('#f14a60')
144                                .setDescription(`This user cannot be tempbanned.`)
145                            ]
146                        });
147    
148                        return;    
149                    }
150                }
151                catch (e) {
152                    console.log(e);
153                    return;
154                }
155            
156              await msg.guild?.bans.create(user, banOptions);              await msg.guild?.bans.create(user, banOptions);
157    
158              const punishment = await Punishment.create({              const punishment = await Punishment.create({
# Line 204  export default class tempBanCommand exte Line 225  export default class tempBanCommand exte
225              return;              return;
226          }          }
227      }      }
 }  
228    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26