Skip to content

Commit

Permalink
feat: keeping up with changes in #5298
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed Feb 12, 2021
1 parent 418a4d2 commit 6e1b85f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/structures/Message.js
Expand Up @@ -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)
*/

/**
Expand All @@ -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,
},
}),
);
}
Expand Down
4 changes: 3 additions & 1 deletion typings/index.d.ts
Expand Up @@ -3189,7 +3189,9 @@ declare module 'discord.js' {
maxUsers?: number;
}

interface ReplyMessageOptions extends Omit<MessageOptions, 'replyTo'> {}
interface ReplyMessageOptions extends Omit<MessageOptions, 'reply'> {
failIfNotExists?: boolean;
}

interface ResolvedOverwriteOptions {
allow: Permissions;
Expand Down

0 comments on commit 6e1b85f

Please sign in to comment.