From 6e1b85f775046d5fa72ce28fe0c4e16c8277a9b3 Mon Sep 17 00:00:00 2001 From: Shubham Parihar Date: Fri, 12 Feb 2021 12:51:23 +0530 Subject: [PATCH] feat: keeping up with changes in #5298 --- src/structures/Message.js | 7 ++++++- typings/index.d.ts | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index 2d55a8c74257..7a6d3561cd33 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -581,6 +581,8 @@ class Message extends Base { * @property {string|boolean} [code] Language for optional codeblock formatting to apply * @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if * it exceeds the character limit. If an object is provided, these are the options for splitting the message + * @property {boolean} [failIfNotExists=true] Whether to error if the referenced message + * does not exist (creates a standard message in this case when false) */ /** @@ -594,7 +596,10 @@ class Message extends Base { content instanceof APIMessage ? content : APIMessage.transformOptions(content, options, { - replyTo: this, + reply: { + messageReference: this, + failIfNotExists: options?.failIfNotExists ?? content?.failIfNotExists ?? true, + }, }), ); } diff --git a/typings/index.d.ts b/typings/index.d.ts index bf2aa4a25133..8d760e8b3452 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3189,7 +3189,9 @@ declare module 'discord.js' { maxUsers?: number; } - interface ReplyMessageOptions extends Omit {} + interface ReplyMessageOptions extends Omit { + failIfNotExists?: boolean; + } interface ResolvedOverwriteOptions { allow: Permissions;