mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
docs: improve documentation (#1898)
* improve channel documentation * forgot some stuff * another one * im good at this * i did a dum
This commit is contained in:
@@ -84,6 +84,19 @@ class GuildAuditLogs {
|
||||
return Promise.all(logs.entries.map(e => e.target)).then(() => logs);
|
||||
}
|
||||
|
||||
/**
|
||||
* The target type of an entry, e.g. `GUILD`. Here are the available types:
|
||||
* * GUILD
|
||||
* * CHANNEL
|
||||
* * USER
|
||||
* * ROLE
|
||||
* * INVITE
|
||||
* * WEBHOOK
|
||||
* * EMOJI
|
||||
* * MESSAGE
|
||||
* @typedef {string} TargetType
|
||||
*/
|
||||
|
||||
/**
|
||||
* Find target type from entry action.
|
||||
* @param {number} target The action target
|
||||
@@ -101,6 +114,13 @@ class GuildAuditLogs {
|
||||
return Targets.UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* The action type of an entry, e.g. `CREATE`. Here are the available types:
|
||||
* * CREATE
|
||||
* * DELETE
|
||||
* * UPDATE
|
||||
* @typedef {string} ActionType
|
||||
*/
|
||||
|
||||
/**
|
||||
* Find action type from entry action.
|
||||
@@ -155,13 +175,13 @@ class GuildAuditLogsEntry {
|
||||
const targetType = GuildAuditLogs.targetType(data.action_type);
|
||||
/**
|
||||
* The target type of this entry
|
||||
* @type {string}
|
||||
* @type {TargetType}
|
||||
*/
|
||||
this.targetType = targetType;
|
||||
|
||||
/**
|
||||
* The action type of this entry
|
||||
* @type {string}
|
||||
* @type {ActionType}
|
||||
*/
|
||||
this.actionType = GuildAuditLogs.actionType(data.action_type);
|
||||
|
||||
@@ -239,7 +259,7 @@ class GuildAuditLogsEntry {
|
||||
if (targetType === Targets.UNKNOWN) {
|
||||
/**
|
||||
* The target of this entry
|
||||
* @type {Snowflake|Guild|User|Role|Emoji|Invite|Webhook}
|
||||
* @type {TargetType}
|
||||
*/
|
||||
this.target = this.changes.reduce((o, c) => {
|
||||
o[c.key] = c.new || c.old;
|
||||
|
||||
Reference in New Issue
Block a user