mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
fix(Thread): make archive_timestamp not nullable (#5965)
This commit is contained in:
@@ -99,12 +99,11 @@ class ThreadChannel extends Channel {
|
|||||||
this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
|
this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The timestamp the thread was last archived or unarchived at
|
* The timestamp when the thread's archive status was last changed
|
||||||
* @type {?number}
|
* <info>If the thread was never archived or unarchived, this is set when it's created</info>
|
||||||
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.archiveTimestamp = data.thread_metadata.archive_timestamp
|
this.archiveTimestamp = new Date(data.thread_metadata.archive_timestamp).getTime();
|
||||||
? new Date(data.thread_metadata.archive_timestamp).getTime()
|
|
||||||
: null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The approximate count of messages in this thread
|
* The approximate count of messages in this thread
|
||||||
@@ -135,12 +134,13 @@ class ThreadChannel extends Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time the thread was last archived or unarchived at
|
* The time when the thread's archive status was last changed
|
||||||
* @type {?Date}
|
* <info>If the thread was never archived or unarchived, this is set when it's created</info>
|
||||||
|
* @type {Date}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get archivedAt() {
|
get archivedAt() {
|
||||||
return this.archiveTimestamp ? new Date(this.archiveTimestamp) : null;
|
return new Date(this.archiveTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
4
typings/index.d.ts
vendored
4
typings/index.d.ts
vendored
@@ -1951,8 +1951,8 @@ declare module 'discord.js' {
|
|||||||
export class ThreadChannel extends TextBasedChannel(Channel) {
|
export class ThreadChannel extends TextBasedChannel(Channel) {
|
||||||
constructor(guild: Guild, data?: object);
|
constructor(guild: Guild, data?: object);
|
||||||
public archived: boolean;
|
public archived: boolean;
|
||||||
public readonly archivedAt: Date | null;
|
public readonly archivedAt: Date;
|
||||||
public archiveTimestamp: number | null;
|
public archiveTimestamp: number;
|
||||||
public autoArchiveDuration: ThreadAutoArchiveDuration;
|
public autoArchiveDuration: ThreadAutoArchiveDuration;
|
||||||
public readonly editable: boolean;
|
public readonly editable: boolean;
|
||||||
public guild: Guild;
|
public guild: Guild;
|
||||||
|
|||||||
Reference in New Issue
Block a user