mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Improve docs a bit
This commit is contained in:
@@ -41,7 +41,7 @@ class GuildAuditLogs {
|
||||
if (data.users) for (const user of data.users) guild.client.dataManager.newUser(user);
|
||||
|
||||
/**
|
||||
* Entries for this Guild's audit logs
|
||||
* The entries for this guild's audit logs
|
||||
* @type {GuildAuditLogsEntry[]}
|
||||
*/
|
||||
this.entries = [];
|
||||
@@ -49,7 +49,7 @@ class GuildAuditLogs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles possible promises for entry targets
|
||||
* Handles possible promises for entry targets.
|
||||
* @returns {GuildAuditLogs}
|
||||
*/
|
||||
static build(...args) {
|
||||
@@ -60,8 +60,8 @@ class GuildAuditLogs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Find target type from entry action
|
||||
* @param {number} target Action target
|
||||
* Find target type from entry action.
|
||||
* @param {number} target The action target
|
||||
* @returns {?string}
|
||||
*/
|
||||
static targetType(target) {
|
||||
@@ -77,8 +77,8 @@ class GuildAuditLogs {
|
||||
|
||||
|
||||
/**
|
||||
* Find action type from entry action
|
||||
* @param {string} action Action target
|
||||
* Find action type from entry action.
|
||||
* @param {string} action The action target
|
||||
* @returns {string}
|
||||
*/
|
||||
static actionType(action) {
|
||||
@@ -123,13 +123,13 @@ class GuildAuditLogsEntry {
|
||||
constructor(guild, data) {
|
||||
const targetType = GuildAuditLogs.targetType(data.action_type);
|
||||
/**
|
||||
* Target type of this entry
|
||||
* The target type of this entry
|
||||
* @type {string}
|
||||
*/
|
||||
this.targetType = targetType;
|
||||
|
||||
/**
|
||||
* Action type of this entry
|
||||
* The action type of this entry
|
||||
* @type {string}
|
||||
*/
|
||||
this.actionType = GuildAuditLogs.actionType(data.action_type);
|
||||
@@ -141,13 +141,13 @@ class GuildAuditLogsEntry {
|
||||
this.action = Object.keys(Actions).find(k => Actions[k] === data.action_type);
|
||||
|
||||
/**
|
||||
* Reason of this entry
|
||||
* The reason of this entry
|
||||
* @type {?string}
|
||||
*/
|
||||
this.reason = data.reason || null;
|
||||
|
||||
/**
|
||||
* User that executed this entry
|
||||
* The user that executed this entry
|
||||
* @type {User}
|
||||
*/
|
||||
this.executor = guild.client.users.get(data.user_id);
|
||||
@@ -159,14 +159,14 @@ class GuildAuditLogsEntry {
|
||||
this.changes = data.changes ? data.changes.map(c => ({ name: c.key, old: c.old_value, new: c.new_value })) : null;
|
||||
|
||||
/**
|
||||
* ID of this entry
|
||||
* The ID of this entry
|
||||
* @type {Snowflake}
|
||||
*/
|
||||
this.id = data.id;
|
||||
|
||||
if ([Targets.USER, Targets.GUILD].includes(targetType)) {
|
||||
/**
|
||||
* Target of this entry
|
||||
* The target of this entry
|
||||
* @type {?Guild|User|Role|Emoji|Invite|Webhook}
|
||||
*/
|
||||
this.target = guild.client[`${targetType.toLowerCase()}s`].get(data.target_id);
|
||||
|
||||
Reference in New Issue
Block a user