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

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

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

revision 362 by rakin, Mon Jul 29 17:29:40 2024 UTC revision 363 by rakin, Mon Jul 29 17:29:47 2024 UTC
# Line 32  export default class ShotCommand extends Line 32  export default class ShotCommand extends
32          let user: GuildMember;          let user: GuildMember;
33          let dm = true;          let dm = true;
34          let reason: string | undefined;          let reason: string | undefined;
35            
36          if (options.isInteraction) {          if (options.isInteraction) {
37              user = await <GuildMember> (msg instanceof ContextMenuInteraction ? options.options.getMember('user') : options.options.getMember('member'));              user = await <GuildMember> (msg instanceof ContextMenuInteraction ? options.options.getMember('user') : options.options.getMember('member'));
38    
# Line 83  export default class ShotCommand extends Line 83  export default class ShotCommand extends
83              }              }
84          }          }
85    
86            const anonymous = options.isInteraction ? options.options.getBoolean('anonymous') ?? false : false;
87    
88          try {                      try {            
89              await Punishment.create({              await Punishment.create({
90                  type: PunishmentType.SHOT,                  type: PunishmentType.SHOT,
# Line 108  export default class ShotCommand extends Line 110  export default class ShotCommand extends
110                                  {                                  {
111                                      name: "Reason",                                      name: "Reason",
112                                      value: typeof reason === 'undefined' ? '*No reason provided*' : reason                                      value: typeof reason === 'undefined' ? '*No reason provided*' : reason
113                                  }                                  },
114                                    ...(!anonymous ? [{
115                                        name: "💉 Doctor",
116                                        value: `${(msg.member?.user as User).tag}`
117                                    }] : [])
118                              ])                              ])
119                      ]                      ]
120                  });                  });
# Line 134  export default class ShotCommand extends Line 140  export default class ShotCommand extends
140                  .setDescription(user.user.tag + " got a shot." + (!dm ? "\nThey have DMs disabled. They will not know that they got a shot." : ''))                  .setDescription(user.user.tag + " got a shot." + (!dm ? "\nThey have DMs disabled. They will not know that they got a shot." : ''))
141                  .addFields([                  .addFields([
142                      {                      {
143                          name: "Given by",                          name: "💉 Doctor",
144                          value: (msg.member!.user as User).tag                          value: (msg.member!.user as User).tag
145                      },                      },
146                      {                      {

Legend:
Removed from v.362  
changed lines
  Added in v.363

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26