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

Diff of /trunk/src/commands/moderation/KickCommand.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 9  import getMember from '../../utils/getMe Line 9  import getMember from '../../utils/getMe
9  import History from '../../automod/History';  import History from '../../automod/History';
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 KickCommand extends BaseCommand {  export default class KickCommand extends BaseCommand {
15      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 85  export default class KickCommand extends Line 86  export default class KickCommand extends
86          }          }
87    
88          try {          try {
89              if (!user.kickable)              if (!user.kickable || shouldNotModerate(client, user))
90                  throw new Error('User not kickable');                  throw new Error('User not kickable');
91                            
92              await user.kick(reason);              await user.kick(reason);
# Line 99  export default class KickCommand extends Line 100  export default class KickCommand extends
100                  reason                  reason
101              });              });
102    
103              await History.create(user.id, msg.guild!, 'kick', msg.member!.user.id, typeof reason === 'undefined' ? null : reason);              // await History.create(user.id, msg.guild!, 'kick', msg.member!.user.id, typeof reason === 'undefined' ? null : reason);
104          }          }
105          catch (e) {          catch (e) {
106              await msg.reply({              await msg.reply({
# Line 134  export default class KickCommand extends Line 135  export default class KickCommand extends
135              ]              ]
136          });          });
137      }      }
 }  
138    }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26