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 EchoCommand extends BaseCommand { |
export default class EchoCommand extends BaseCommand { |
14 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
58 |
return; |
return; |
59 |
} |
} |
60 |
|
|
61 |
try { |
try { |
62 |
|
let { embeds, content: parsedContent } = parseEmbedsInString(content); |
63 |
|
|
64 |
await channel.send({ |
await channel.send({ |
65 |
content |
content: parsedContent.trim() === '' ? undefined : parsedContent, |
66 |
|
embeds, |
67 |
|
attachments: msg instanceof CommandInteraction ? undefined : [...msg.attachments.values()] |
68 |
}); |
}); |
69 |
|
|
70 |
if (options.isInteraction) { |
if (options.isInteraction) { |
88 |
embeds: [ |
embeds: [ |
89 |
new MessageEmbed() |
new MessageEmbed() |
90 |
.setColor('#f14a60') |
.setColor('#f14a60') |
91 |
.setDescription(`Failed to send message. Maybe missing permissions?`) |
.setDescription(`Failed to send message. Maybe missing permissions or invalid embed schema?`) |
92 |
], |
], |
93 |
ephemeral: true |
ephemeral: true |
94 |
}); |
}); |