/[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 194 by rakin, Mon Jul 29 17:28:58 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 { hasPermission, 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 && !(await hasPermission(client, member, msg, null, "You don't have permission to ban " + user.tag + ".")))
107                                break;
108                                
109                            if (member && shouldNotModerate(client, member)) {
110                                await msg.reply({
111                                    embeds: [
112                                        new MessageEmbed()
113                                        .setColor('#f14a60')
114                                        .setDescription('The user ' + user.tag + ' is not bannable.')
115                                    ]
116                                });
117    
118                                return;
119                            }
120                        }
121                        catch (e) {
122                            console.log(e);
123                        }
124    
125                      await Punishment.create({                      await Punishment.create({
126                          type: PunishmentType.BAN,                          type: PunishmentType.BAN,
127                          user_id: user.id,                          user_id: user.id,
# Line 144  export default class MassBanCommand exte Line 167  export default class MassBanCommand exte
167              ]              ]
168          });          });
169      }      }
 }  
170    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26