mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(Client): make use of with_expiration in #fetchInvite (#5764)
This commit is contained in:
@@ -109,6 +109,8 @@ class Invite extends Base {
|
||||
* @type {?number}
|
||||
*/
|
||||
this.createdTimestamp = 'created_at' in data ? new Date(data.created_at).getTime() : null;
|
||||
|
||||
this._expiresTimestamp = 'expires_at' in data ? new Date(data.expires_at).getTime() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +143,10 @@ class Invite extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get expiresTimestamp() {
|
||||
return this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null;
|
||||
return (
|
||||
this._expiresTimestamp ??
|
||||
(this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user