mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 14:41:36 +00:00
feat(InlineReplies): add Message#replyReference property
This commit is contained in:
parent
0ed281888d
commit
ab5ee838a3
2 changed files with 12 additions and 0 deletions
|
|
@ -223,6 +223,17 @@ class Message extends Base {
|
|||
messageID: data.message_reference.message_id,
|
||||
}
|
||||
: null;
|
||||
|
||||
/**
|
||||
* The message this message replies to
|
||||
* @type {?Message}
|
||||
*/
|
||||
if ('referenced_message' in data) {
|
||||
this.replyReference =
|
||||
this.channel.messages.get(data.referenced_message.id) || this.channel.messages.add(data.referenced_message);
|
||||
} else {
|
||||
this.replyReference = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
|
|
@ -1011,6 +1011,7 @@ declare module 'discord.js' {
|
|||
public webhookID: Snowflake | null;
|
||||
public flags: Readonly<MessageFlags>;
|
||||
public reference: MessageReference | null;
|
||||
public replyReference: Message | null;
|
||||
public awaitReactions(
|
||||
filter: CollectorFilter,
|
||||
options?: AwaitReactionsOptions,
|
||||
|
|
|
|||
Loading…
Reference in a new issue