/[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

trunk/src/commands/moderation/BeanCommand.ts revision 189 by rakin, Mon Jul 29 17:28:56 2024 UTC trunk/src/commands/moderation/ShotCommand.ts revision 336 by rakin, Mon Jul 29 17:29:36 2024 UTC
# Line 11  import Punishment from '../../models/Pun Line 11  import Punishment from '../../models/Pun
11  import PunishmentType from '../../types/PunishmentType';  import PunishmentType from '../../types/PunishmentType';
12  import ModerationEmbed from '../../utils/ModerationEmbed';  import ModerationEmbed from '../../utils/ModerationEmbed';
13    
14  export default class BeanCommand extends BaseCommand {  export default class ShotCommand extends BaseCommand {
15      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
16      supportsContextMenu: boolean = true;      supportsContextMenu: boolean = true;
17    
18      constructor() {      constructor() {
19          super('bean', 'moderation', ['Bean']);          super('shot', 'moderation', ['Shot']);
20      }      }
21    
22      async run(client: DiscordClient, msg: Message | CommandInteraction | ContextMenuInteraction, options: CommandOptions | InteractionOptions) {      async run(client: DiscordClient, msg: Message | CommandInteraction | ContextMenuInteraction, options: CommandOptions | InteractionOptions) {
# Line 88  export default class BeanCommand extends Line 88  export default class BeanCommand extends
88    
89          try {                      try {            
90              await Punishment.create({              await Punishment.create({
91                  type: PunishmentType.BEAN,                  type: PunishmentType.SHOT,
92                  user_id: user.id,                  user_id: user.id,
93                  guild_id: msg.guild!.id,                  guild_id: msg.guild!.id,
94                  mod_id: msg.member!.user.id,                  mod_id: msg.member!.user.id,
95                  mod_tag: (msg.member!.user as User).tag,                  mod_tag: (msg.member!.user as User).tag,
96                  reason                  reason,
97                    createdAt: new Date()
98              });              });
99    
100              await History.create(user.id, msg.guild!, 'bean', msg.member!.user.id, typeof reason === 'undefined' ? null : reason);              // await History.create(user.id, msg.guild!, 'bean', msg.member!.user.id, typeof reason === 'undefined' ? null : reason);
101    
102              try {              try {
103                  await user.send({                  await user.send({
# Line 104  export default class BeanCommand extends Line 105  export default class BeanCommand extends
105                          new MessageEmbed()                          new MessageEmbed()
106                              .setAuthor({                              .setAuthor({
107                                  iconURL: <string> msg.guild!.iconURL(),                                  iconURL: <string> msg.guild!.iconURL(),
108                                  name: `\tYou have been beaned in ${msg.guild!.name}`                                  name: `\tYou got a shot in ${msg.guild!.name}`
109                              })                              })
110                              .addFields([                              .addFields([
111                                  {                                  {
# Line 120  export default class BeanCommand extends Line 121  export default class BeanCommand extends
121                  dm = false;                  dm = false;
122              }              }
123    
124              await client.logger.logBeaned(user, typeof reason === 'undefined' ? '*No reason provided*' : reason, msg.member!.user as User);              // await client.logger.logBeaned(user, typeof reason === 'undefined' ? '*No reason provided*' : reason, msg.member!.user as User);
125          }          }
126          catch (e) {          catch (e) {
127              console.log(e);                          console.log(e);            
128          }          }
129    
130          /*await msg.reply({          await msg.reply({
131              embeds: [              embeds: [
132                  new MessageEmbed()                  new MessageEmbed()
133                  .setAuthor({                  .setAuthor({
134                      name: user.user.tag,                      name: user.user.tag,
135                      iconURL: user.user.displayAvatarURL(),                      iconURL: user.user.displayAvatarURL(),
136                  })                  })
137                  .setDescription(user.user.tag + " has been beaned." + (!dm ? "\nThey have DMs disabled. They will not know that they have been beaned." : ''))                  .setDescription(user.user.tag + " got a shot." + (!dm ? "\nThey have DMs disabled. They will not know that they got a shot." : ''))
138                  .addFields([                  .addFields([
139                      {                      {
140                          name: "Beaned by",                          name: "Given by",
141                          value: (msg.member!.user as User).tag                          value: (msg.member!.user as User).tag
142                      },                      },
143                      {                      {
# Line 145  export default class BeanCommand extends Line 146  export default class BeanCommand extends
146                      }                      }
147                  ])                  ])
148              ]              ]
         });*/  
   
         await msg.reply({  
             embeds: [  
                 new ModerationEmbed(user, msg.member!.user, {  
                     description: `${user.tag} has been beaned.`  
                 })  
                 .setReason(reason)  
             ]  
149          });          });
150      }      }
151  }  }

Legend:
Removed from v.189  
changed lines
  Added in v.336

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26