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

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

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

revision 86 by rakin, Mon Jul 29 17:28:32 2024 UTC revision 153 by rakin, Mon Jul 29 17:28:48 2024 UTC
# Line 9  import History from '../../automod/Histo Line 9  import History from '../../automod/Histo
9  import { fetchEmoji } from '../../utils/Emoji';  import { fetchEmoji } from '../../utils/Emoji';
10  import Punishment from '../../models/Punishment';  import Punishment from '../../models/Punishment';
11  import PunishmentType from '../../types/PunishmentType';  import PunishmentType from '../../types/PunishmentType';
12    import { shouldNotModerate } from '../../utils/util';
13    
14  export default class MassBanCommand extends BaseCommand {  export default class MassBanCommand extends BaseCommand {
15      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 99  export default class MassBanCommand exte Line 100  export default class MassBanCommand exte
100                  try {                  try {
101                      console.log(banOptions.reason);                      console.log(banOptions.reason);
102    
103                        try {
104                            const member = await msg.guild?.members.fetch(user.id);
105    
106                            if (member && shouldNotModerate(client, member)) {
107                                await msg.reply({
108                                    embeds: [
109                                        new MessageEmbed()
110                                        .setColor('#f14a60')
111                                        .setDescription('The user ' + user.tag + ' is not bannable.')
112                                    ]
113                                });
114    
115                                return;
116                            }
117                        }
118                        catch (e) {
119                            console.log(e);
120                            continue;
121                        }
122    
123                      await Punishment.create({                      await Punishment.create({
124                          type: PunishmentType.BAN,                          type: PunishmentType.BAN,
125                          user_id: user.id,                          user_id: user.id,
# Line 144  export default class MassBanCommand exte Line 165  export default class MassBanCommand exte
165              ]              ]
166          });          });
167      }      }
 }  
168    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26