/[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 163 by rakin, Mon Jul 29 17:28:50 2024 UTC revision 189 by rakin, Mon Jul 29 17:28:56 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 ModerationEmbed from '../../utils/ModerationEmbed';
13    
14  export default class BeanCommand extends BaseCommand {  export default class BeanCommand extends BaseCommand {
15      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 97  export default class BeanCommand extends Line 98  export default class BeanCommand extends
98    
99              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);
100    
101          try {              try {
102              await user.send({                  await user.send({
103                  embeds: [                      embeds: [
104                      new MessageEmbed()                          new MessageEmbed()
105                          .setAuthor({                              .setAuthor({
106                              iconURL: <string> msg.guild!.iconURL(),                                  iconURL: <string> msg.guild!.iconURL(),
107                              name: `\tYou have been beaned in ${msg.guild!.name}`                                  name: `\tYou have been beaned in ${msg.guild!.name}`
108                          })                              })
109                          .addFields([                              .addFields([
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                          ])                              ])
115                  ]                      ]
116              });                  });
117              }              }
118              catch (e) {              catch (e) {
119                  console.log(e);                  console.log(e);
# Line 125  export default class BeanCommand extends Line 126  export default class BeanCommand extends
126              console.log(e);                          console.log(e);            
127          }          }
128    
129          await msg.reply({          /*await msg.reply({
130              embeds: [              embeds: [
131                  new MessageEmbed()                  new MessageEmbed()
132                  .setAuthor({                  .setAuthor({
# Line 144  export default class BeanCommand extends Line 145  export default class BeanCommand extends
145                      }                      }
146                  ])                  ])
147              ]              ]
148            });*/
149    
150            await msg.reply({
151                embeds: [
152                    new ModerationEmbed(user, msg.member!.user, {
153                        description: `${user.tag} has been beaned.`
154                    })
155                    .setReason(reason)
156                ]
157          });          });
158      }      }
159  }  }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26