mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Add Message.edits (#636)
* Add Message.edits * Make travis happy * Change @type for consistency
This commit is contained in:
committed by
Schuyler Cebulskie
parent
e4cac2d575
commit
17bee8084e
@@ -123,6 +123,8 @@ class Message {
|
||||
}
|
||||
}
|
||||
|
||||
this._edits = [];
|
||||
|
||||
/**
|
||||
* Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications)
|
||||
* @type {boolean}
|
||||
@@ -147,6 +149,15 @@ class Message {
|
||||
return new Date(this._editedTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of cached versions of the message, including the current version.
|
||||
* Sorted from latest (first) to oldest (last).
|
||||
* @type {Message[]}
|
||||
*/
|
||||
get edits() {
|
||||
return this._edits.slice().unshift(this);
|
||||
}
|
||||
|
||||
patch(data) { // eslint-disable-line complexity
|
||||
if (data.author) {
|
||||
this.author = this.client.users.get(data.author.id);
|
||||
|
||||
Reference in New Issue
Block a user