mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Add <User/Guild/Role/Channel>.createdAt (#620)
* Add Role.createdAt * Add Channel.createdAt * Add Guild.createdAt * Add User.createdAt * Change createdAt to Unix Timestamp * Add createdAt to Emojis * Change createdAt to Unix Timestamp
This commit is contained in:
@@ -53,6 +53,15 @@ class User {
|
||||
this.game = data.game || this.game;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unix timestamp the user was created
|
||||
* @readonly
|
||||
* @type {Date}
|
||||
*/
|
||||
get createdAt() {
|
||||
return new Date((+this.id / 4194304) + 1420070400000).getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically concatenates the User's mention instead of the User object.
|
||||
* @returns {string}
|
||||
|
||||
Reference in New Issue
Block a user