backport(TextBasedChannel): add lastPinTimestamp and lastPinAt (#2870)

And clarify Client#channelPinsUpdate's 'time' parameter.
This commit is contained in:
SpaceEEC
2018-10-10 10:01:04 +02:00
committed by GitHub
parent fcf4745a43
commit ea3e575546
6 changed files with 47 additions and 2 deletions

View File

@@ -30,6 +30,12 @@ class TextBasedChannel {
* @type {?Message}
*/
this.lastMessage = null;
/**
* The timestamp when the last pinned message was pinned, if there was one
* @type {?number}
*/
this.lastPinTimestamp = null;
}
/**
@@ -389,6 +395,15 @@ class TextBasedChannel {
return 0;
}
/**
* The date when the last pinned message was pinned, if there was one
* @type {?Date}
* @readonly
*/
get lastPinAt() {
return this.lastPinTimestamp ? new Date(this.lastPinTimestamp) : null;
}
/**
* Creates a Message Collector
* @param {CollectorFilter} filter The filter to create the collector with
@@ -584,6 +599,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
'fetchMessages',
'fetchMessage',
'search',
'lastPinAt',
'bulkDelete',
'startTyping',
'stopTyping',