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:
Isabella
2017-09-07 19:01:35 -05:00
committed by Crawl
parent 41c4999c2b
commit 0607720ec8
7 changed files with 35 additions and 15 deletions

View File

@@ -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;