mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Add Invite.expiresAt/expiresTimestamp
This commit is contained in:
@@ -108,6 +108,24 @@ class Invite {
|
||||
return new Date(this.createdTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* The timestamp the invite will expire at
|
||||
* @type {number}
|
||||
* @readonly
|
||||
*/
|
||||
get expiresTimestamp() {
|
||||
return this.createdTimestamp + (this.maxAge * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* The time the invite will expire
|
||||
* @type {Date}
|
||||
* @readonly
|
||||
*/
|
||||
get expiresAt() {
|
||||
return new Date(this.expiresTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL to the invite
|
||||
* @type {string}
|
||||
|
||||
Reference in New Issue
Block a user