From 2d416cca794bde593de5de5a0b1badef160b085e Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Mon, 1 May 2017 21:07:46 +0100 Subject: [PATCH] Improve GuildAuditLogs documentation by creating an AuditLogChange typedef --- src/structures/GuildAuditLogs.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/structures/GuildAuditLogs.js b/src/structures/GuildAuditLogs.js index 6f6e04dcd..3e32cdb86 100644 --- a/src/structures/GuildAuditLogs.js +++ b/src/structures/GuildAuditLogs.js @@ -165,9 +165,17 @@ class GuildAuditLogsEntry { */ this.executor = guild.client.users.get(data.user_id); + /** + * An entry in the audit log representing a specific change + * @typedef {object} AuditLogChange + * @property {string} name The name of the change, e.g. `nick` for nickname changes + * @property {string|boolean|number} [old] The old value of the change, e.g. for nicknames, the old nickname + * @property {string|boolean|number} new The new value of the change, e.g. for nicknames, the new nickname + */ + /** * Specific property changes - * @type {Object[]} + * @type {AuditLogChange[]} */ this.changes = data.changes ? data.changes.map(c => ({ name: c.key, old: c.old_value, new: c.new_value })) : null;