fix(TextBasedChannel): added missing lastMessage functionality in textchannels (#2999)

This commit is contained in:
Drahcirius
2018-12-23 23:16:50 -05:00
committed by Isabella
parent 2aa8e1d9c1
commit 7186c91063
2 changed files with 10 additions and 2 deletions

View File

@@ -395,6 +395,15 @@ class TextBasedChannel {
return 0;
}
/**
* The Message object of the last message in the channel, if one was sent
* @type {?Message}
* @readonly
*/
get lastMessage() {
return this.messages.get(this.lastMessageID) || null;
}
/**
* The date when the last pinned message was pinned, if there was one
* @type {?Date}
@@ -599,6 +608,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
'fetchMessages',
'fetchMessage',
'search',
'lastMessage',
'lastPinAt',
'bulkDelete',
'startTyping',