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

Diff of /trunk/src/commands/moderation/SendCommand.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 257 by rakin, Mon Jul 29 17:29:14 2024 UTC
# Line 8  import getUser from '../../utils/getUser Line 8  import getUser from '../../utils/getUser
8  import getMember from '../../utils/getMember';  import getMember from '../../utils/getMember';
9  import History from '../../automod/History';  import History from '../../automod/History';
10  import { fetchEmoji } from '../../utils/Emoji';  import { fetchEmoji } from '../../utils/Emoji';
11    import { parseEmbedsInString } from '../../utils/util';
12    
13  export default class SendCommand extends BaseCommand {  export default class SendCommand extends BaseCommand {
14      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 56  export default class SendCommand extends Line 57  export default class SendCommand extends
57          }          }
58    
59          try {          try {
60                let { embeds, content: parsedContent } = parseEmbedsInString(content);
61    
62              await member.send({              await member.send({
63                  content                  content: parsedContent.trim() === '' ? undefined : parsedContent,
64                    embeds,
65                    attachments: msg instanceof CommandInteraction ? undefined : [...msg.attachments.values()]
66              });              });
67    
68              if (options.isInteraction) {              if (options.isInteraction) {
# Line 81  export default class SendCommand extends Line 86  export default class SendCommand extends
86                  embeds: [                  embeds: [
87                      new MessageEmbed()                      new MessageEmbed()
88                      .setColor('#f14a60')                      .setColor('#f14a60')
89                      .setDescription(`Failed to send message. Maybe missing permissions or the user has disabled DMs?`)                      .setDescription(`Failed to send message. Maybe invalid embed schema or the user has disabled DMs?`)
90                  ],                  ],
91                  ephemeral: true                  ephemeral: true
92              });              });

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26