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

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

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

revision 125 by rakin, Mon Jul 29 17:28:41 2024 UTC revision 153 by rakin, Mon Jul 29 17:28:48 2024 UTC
# Line 8  import getUser from '../../utils/getUser Line 8  import getUser from '../../utils/getUser
8  import History from '../../automod/History';  import History from '../../automod/History';
9  import Punishment from '../../models/Punishment';  import Punishment from '../../models/Punishment';
10  import PunishmentType from '../../types/PunishmentType';  import PunishmentType from '../../types/PunishmentType';
11    import { shouldNotModerate } from '../../utils/util';
12    
13  export default class BanCommand extends BaseCommand {  export default class BanCommand extends BaseCommand {
14      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 105  export default class BanCommand extends Line 106  export default class BanCommand extends
106              }              }
107          }          }
108    
109            try {
110                const member = await msg.guild?.members.fetch(user.id);
111    
112                if (member && shouldNotModerate(client, member)) {
113                    await msg.reply({
114                        embeds: [
115                            new MessageEmbed()
116                            .setColor('#f14a60')
117                            .setDescription('Cannot ban this user: Operation not permitted')    
118                        ]
119                    });
120                    
121                    return;
122                }
123            }
124            catch (e) {
125                console.log(e);
126                return;
127            }
128            
129          try {          try {
130              await msg.guild?.bans.create(user, banOptions);              await msg.guild?.bans.create(user, banOptions);
131    
# Line 156  export default class BanCommand extends Line 177  export default class BanCommand extends
177              ]              ]
178          });          });
179      }      }
 }  
180    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26