/[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 51 by rakin, Mon Jul 29 17:28:23 2024 UTC revision 86 by rakin, Mon Jul 29 17:28:32 2024 UTC
# Line 6  import InteractionOptions from '../../ty Line 6  import InteractionOptions from '../../ty
6  import MessageEmbed from '../../client/MessageEmbed';  import MessageEmbed from '../../client/MessageEmbed';
7  import getUser from '../../utils/getUser';  import getUser from '../../utils/getUser';
8  import History from '../../automod/History';  import History from '../../automod/History';
9    import Punishment from '../../models/Punishment';
10    import PunishmentType from '../../types/PunishmentType';
11    
12  export default class BanCommand extends BaseCommand {  export default class BanCommand extends BaseCommand {
13      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 104  export default class BanCommand extends Line 106  export default class BanCommand extends
106    
107          try {          try {
108              await msg.guild?.bans.create(user, banOptions);              await msg.guild?.bans.create(user, banOptions);
109    
110                await Punishment.create({
111                    type: PunishmentType.BAN,
112                    user_id: user.id,
113                    guild_id: msg.guild!.id,
114                    mod_id: msg.member!.user.id,
115                    mod_tag: (msg.member!.user as User).tag,
116                    reason: banOptions.reason ?? undefined
117                });
118    
119              await History.create(user.id, msg.guild!, 'ban', msg.member!.user.id, typeof banOptions.reason === 'undefined' ? null : banOptions.reason, async (data: any) => undefined);              await History.create(user.id, msg.guild!, 'ban', msg.member!.user.id, typeof banOptions.reason === 'undefined' ? null : banOptions.reason, async (data: any) => undefined);
120          }          }
121          catch (e) {          catch (e) {

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26