diff --git a/src/structures/GuildAuditLogs.js b/src/structures/GuildAuditLogs.js index 287867621..6f6e04dcd 100644 --- a/src/structures/GuildAuditLogs.js +++ b/src/structures/GuildAuditLogs.js @@ -1,4 +1,5 @@ const Collection = require('../util/Collection'); +const Snowflake = require('../util/Snowflake'); const Targets = { GUILD: 'GUILD', @@ -226,6 +227,24 @@ class GuildAuditLogsEntry { this.target = guild[`${targetType.toLowerCase()}s`].get(data.target_id); } } + + /** + * The timestamp this entry was created at + * @type {number} + * @readonly + */ + get createdTimestamp() { + return Snowflake.deconstruct(this.id).timestamp; + } + + /** + * The time this entry was created + * @type {Date} + * @readonly + */ + get createdAt() { + return new Date(this.createdTimestamp); + } } GuildAuditLogs.Actions = Actions;