aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/suicide.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/utilities/suicide.ts')
-rw-r--r--src/commands/utilities/suicide.ts21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts
index f0d75a2..b347f9c 100644
--- a/src/commands/utilities/suicide.ts
+++ b/src/commands/utilities/suicide.ts
@@ -1,5 +1,5 @@
import { AllowedMentions, BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
-import { MessageEmbed, type Message } from 'discord.js';
+import { MessageEmbed } from 'discord.js';
export default class TemplateCommand extends BushCommand {
public constructor() {
@@ -44,17 +44,14 @@ export default class TemplateCommand extends BushCommand {
].join('\n')
);
- return (
+ return message.util.send({
+ embeds: [suicideEmbed],
+ allowedMentions: AllowedMentions.users(),
// If the original message was a reply -> imitate it
- !message.util.isSlashMessage(message) && (message as Message).reference?.messageId && message.guild && message.channel
- ? await message.channel.messages.fetch((message as Message).reference!.messageId!).then(async (message1) => {
- await message1.reply({
- embeds: [suicideEmbed],
- allowedMentions: AllowedMentions.users(),
- target: message1
- });
- })
- : await message.util.send({ embeds: [suicideEmbed], allowedMentions: AllowedMentions.users() })
- );
+ reply:
+ !message.util.isSlashMessage(message) && message.reference?.messageId
+ ? { messageReference: message.reference.messageId }
+ : undefined
+ });
}
}