mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(TextBasedChannel): add lastPinTimestamp and lastPinAt (#2813)
* add lastPinTimestamp * typings * use or instead of ternary
This commit is contained in:
@@ -21,6 +21,12 @@ class TextBasedChannel {
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.lastMessageID = null;
|
||||
|
||||
/**
|
||||
* The timestamp when the last pinned message was pinned, if there was one
|
||||
* @type {?number}
|
||||
*/
|
||||
this.lastPinTimestamp = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,6 +38,15 @@ class TextBasedChannel {
|
||||
return this.messages.get(this.lastMessageID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options provided when sending or editing a message.
|
||||
* @typedef {Object} MessageOptions
|
||||
@@ -322,6 +337,7 @@ class TextBasedChannel {
|
||||
if (full) {
|
||||
props.push(
|
||||
'lastMessage',
|
||||
'lastPinAt',
|
||||
'bulkDelete',
|
||||
'startTyping',
|
||||
'stopTyping',
|
||||
|
||||
Reference in New Issue
Block a user