Doc fixes, mostly pertaining to Snowflakes (#1218)

GUS!!!! @GusCaplan
This commit is contained in:
Programmix
2017-02-24 12:33:51 -08:00
committed by Schuyler Cebulskie
parent 76637ed10d
commit a029999b09
12 changed files with 27 additions and 27 deletions

View File

@@ -210,7 +210,7 @@ class Client extends EventEmitter {
/** /**
* All active voice connections that have been established, mapped by channel ID * All active voice connections that have been established, mapped by channel ID
* @type {Collection<string, VoiceConnection>} * @type {Collection<Snowflake, VoiceConnection>}
* @readonly * @readonly
*/ */
get voiceConnections() { get voiceConnections() {
@@ -303,7 +303,7 @@ class Client extends EventEmitter {
/** /**
* Obtains a user from Discord, or the user cache if it's already available. * Obtains a user from Discord, or the user cache if it's already available.
* <warn>This is only available when using a bot account.</warn> * <warn>This is only available when using a bot account.</warn>
* @param {string} id ID of the user * @param {Snowflake} id ID of the user
* @param {boolean} [cache=true] Whether to cache the new user object if it isn't already * @param {boolean} [cache=true] Whether to cache the new user object if it isn't already
* @returns {Promise<User>} * @returns {Promise<User>}
*/ */
@@ -324,7 +324,7 @@ class Client extends EventEmitter {
/** /**
* Obtains a webhook from Discord. * Obtains a webhook from Discord.
* @param {string} id ID of the webhook * @param {Snowflake} id ID of the webhook
* @param {string} [token] Token for the webhook * @param {string} [token] Token for the webhook
* @returns {Promise<Webhook>} * @returns {Promise<Webhook>}
*/ */
@@ -467,7 +467,7 @@ class Client extends EventEmitter {
/** /**
* Adds/updates a friend's presence in {@link Client#presences}. * Adds/updates a friend's presence in {@link Client#presences}.
* @param {string} id ID of the user * @param {Snowflake} id ID of the user
* @param {Object} presence Raw presence object from Discord * @param {Object} presence Raw presence object from Discord
* @private * @private
*/ */

View File

@@ -102,7 +102,7 @@ class ClientDataResolver {
} }
/** /**
* Data that can be resolved to give a Channel. This can be: * Data that can be resolved to give a Channel object. This can be:
* * A Channel object * * A Channel object
* * A Message object (the channel the message was sent in) * * A Message object (the channel the message was sent in)
* * A Guild object (the #general channel) * * A Guild object (the #general channel)
@@ -124,7 +124,7 @@ class ClientDataResolver {
} }
/** /**
* Resolves a ChannelResolvable to a Channel object * Resolves a ChannelResolvable to a channel ID
* @param {ChannelResolvable} channel The channel resolvable to resolve * @param {ChannelResolvable} channel The channel resolvable to resolve
* @returns {?Snowflake} * @returns {?Snowflake}
*/ */

View File

@@ -10,7 +10,7 @@ const Util = require('../util/Util');
*/ */
class WebhookClient extends Webhook { class WebhookClient extends Webhook {
/** /**
* @param {string} id ID of the webhook * @param {Snowflake} id ID of the webhook
* @param {string} token Token of the webhook * @param {string} token Token of the webhook
* @param {ClientOptions} [options] Options for the client * @param {ClientOptions} [options] Options for the client
* @example * @example

View File

@@ -105,7 +105,7 @@ class Emoji {
* Data for editing an emoji * Data for editing an emoji
* @typedef {Object} EmojiEditData * @typedef {Object} EmojiEditData
* @property {string} [name] The name of the emoji * @property {string} [name] The name of the emoji
* @property {Collection<string, Role>|Array<string|Role>} [roles] Roles to restrict emoji to * @property {Collection<Snowflake, Role>|Array<Snowflake|Role>} [roles] Roles to restrict emoji to
*/ */
/** /**

View File

@@ -639,7 +639,7 @@ class Guild {
/** /**
* The data needed for updating a channel's position. * The data needed for updating a channel's position.
* @typedef {Object} ChannelPosition * @typedef {Object} ChannelPosition
* @property {string} id The channel being updated's unique id. * @property {Snowflake} id The channel being updated's unique id.
* @property {number} position The new position of the channel. * @property {number} position The new position of the channel.
*/ */
@@ -680,7 +680,7 @@ class Guild {
/** /**
* Set the position of a role in this guild * Set the position of a role in this guild
* @param {string|Role} role the role to edit, can be a role object or a role ID. * @param {Role|Snowflake} role the role to edit, can be a role object or a role ID.
* @param {number} position the new position of the role * @param {number} position the new position of the role
* @param {boolean} [relative=false] Position moves the role relative to its current position * @param {boolean} [relative=false] Position moves the role relative to its current position
* @returns {Promise<Guild>} * @returns {Promise<Guild>}
@@ -707,7 +707,7 @@ class Guild {
* Creates a new custom emoji in the guild. * Creates a new custom emoji in the guild.
* @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji. * @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji.
* @param {string} name The name for the emoji. * @param {string} name The name for the emoji.
* @param {Collection<Role>|Role[]} [roles] Roles to limit the emoji to * @param {Collection<Snowflake, Role>|Role[]} [roles] Roles to limit the emoji to
* @returns {Promise<Emoji>} The created emoji. * @returns {Promise<Emoji>} The created emoji.
* @example * @example
* // create a new emoji from a url * // create a new emoji from a url

View File

@@ -322,7 +322,7 @@ class GuildMember {
/** /**
* Sets the roles applied to the member. * Sets the roles applied to the member.
* @param {Collection<Snowflake, Role>|Role[]|string[]} roles The roles or role IDs to apply * @param {Collection<Snowflake, Role>|Role[]|Snowflake[]} roles The roles or role IDs to apply
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
*/ */
setRoles(roles) { setRoles(roles) {
@@ -331,7 +331,7 @@ class GuildMember {
/** /**
* Adds a single role to the member. * Adds a single role to the member.
* @param {Role|string} role The role or ID of the role to add * @param {Role|Snowflake} role The role or ID of the role to add
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
*/ */
addRole(role) { addRole(role) {
@@ -341,7 +341,7 @@ class GuildMember {
/** /**
* Adds multiple roles to the member. * Adds multiple roles to the member.
* @param {Collection<Snowflake, Role>|Role[]|string[]} roles The roles or role IDs to add * @param {Collection<Snowflake, Role>|Role[]|Snowflake[]} roles The roles or role IDs to add
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
*/ */
addRoles(roles) { addRoles(roles) {
@@ -357,7 +357,7 @@ class GuildMember {
/** /**
* Removes a single role from the member. * Removes a single role from the member.
* @param {Role|string} role The role or ID of the role to remove * @param {Role|Snowflake} role The role or ID of the role to remove
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
*/ */
removeRole(role) { removeRole(role) {
@@ -367,7 +367,7 @@ class GuildMember {
/** /**
* Removes multiple roles from the member. * Removes multiple roles from the member.
* @param {Collection<Snowflake, Role>|Role[]|string[]} roles The roles or role IDs to remove * @param {Collection<Snowflake, Role>|Role[]|Snowflake[]} roles The roles or role IDs to remove
* @returns {Promise<GuildMember>} * @returns {Promise<GuildMember>}
*/ */
removeRoles(roles) { removeRoles(roles) {

View File

@@ -154,7 +154,7 @@ class Message {
/** /**
* A collection of reactions to this message, mapped by the reaction "id". * A collection of reactions to this message, mapped by the reaction "id".
* @type {Collection<Snowflake|string, MessageReaction>} * @type {Collection<Snowflake, MessageReaction>}
*/ */
this.reactions = new Collection(); this.reactions = new Collection();

View File

@@ -71,7 +71,7 @@ class MessageReaction {
/** /**
* Fetch all the users that gave this reaction. Resolves with a collection of users, mapped by their IDs. * Fetch all the users that gave this reaction. Resolves with a collection of users, mapped by their IDs.
* @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100 * @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100
* @returns {Promise<Collection<string, User>>} * @returns {Promise<Collection<Snowflake, User>>}
*/ */
fetchUsers(limit = 100) { fetchUsers(limit = 100) {
const message = this.message; const message = this.message;

View File

@@ -109,7 +109,7 @@ class RichEmbed {
/** /**
* Sets the color of this embed * Sets the color of this embed
* @param {ColorResolvable} color The color to set * @param {ColorResolvable} color The color of the embed
* @returns {RichEmbed} This embed * @returns {RichEmbed} This embed
*/ */
setColor(color) { setColor(color) {

View File

@@ -221,7 +221,7 @@ class Role {
/** /**
* Set a new color for the role * Set a new color for the role
* @param {number|string} color The new color for the role, either a hex string or a base 10 number * @param {ColorResolvable} color The color of the role
* @returns {Promise<Role>} * @returns {Promise<Role>}
* @example * @example
* // set the color of a role * // set the color of a role

View File

@@ -44,7 +44,7 @@ class TextChannel extends GuildChannel {
/** /**
* Fetch all webhooks for the channel. * Fetch all webhooks for the channel.
* @returns {Promise<Collection<string, Webhook>>} * @returns {Promise<Collection<Snowflake, Webhook>>}
*/ */
fetchWebhooks() { fetchWebhooks() {
return this.client.rest.methods.getChannelWebhooks(this); return this.client.rest.methods.getChannelWebhooks(this);

View File

@@ -161,7 +161,7 @@ class TextBasedChannel {
/** /**
* Gets a single message from this channel, regardless of it being cached or not. * Gets a single message from this channel, regardless of it being cached or not.
* <warn>This is only available when using a bot account.</warn> * <warn>This is only available when using a bot account.</warn>
* @param {string} messageID ID of the message to get * @param {Snowflake} messageID ID of the message to get
* @returns {Promise<Message>} * @returns {Promise<Message>}
* @example * @example
* // get message * // get message
@@ -182,9 +182,9 @@ class TextBasedChannel {
* `after` are mutually exclusive. All the parameters are optional. * `after` are mutually exclusive. All the parameters are optional.
* @typedef {Object} ChannelLogsQueryOptions * @typedef {Object} ChannelLogsQueryOptions
* @property {number} [limit=50] Number of messages to acquire * @property {number} [limit=50] Number of messages to acquire
* @property {string} [before] ID of a message to get the messages that were posted before it * @property {Snowflake} [before] ID of a message to get the messages that were posted before it
* @property {string} [after] ID of a message to get the messages that were posted after it * @property {Snowflake} [after] ID of a message to get the messages that were posted after it
* @property {string} [around] ID of a message to get the messages that were posted around it * @property {Snowflake} [around] ID of a message to get the messages that were posted around it
*/ */
/** /**
@@ -228,8 +228,8 @@ class TextBasedChannel {
/** /**
* @typedef {Object} MessageSearchOptions * @typedef {Object} MessageSearchOptions
* @property {string} [content] Message content * @property {string} [content] Message content
* @property {string} [maxID] Maximum ID for the filter * @property {Snowflake} [maxID] Maximum ID for the filter
* @property {string} [minID] Minimum ID for the filter * @property {Snowflake} [minID] Minimum ID for the filter
* @property {string} [has] One of `link`, `embed`, `file`, `video`, `image`, or `sound`, * @property {string} [has] One of `link`, `embed`, `file`, `video`, `image`, or `sound`,
* or add `-` to negate (e.g. `-file`) * or add `-` to negate (e.g. `-file`)
* @property {ChannelResolvable} [channel] Channel to limit search to (only for guild search endpoint) * @property {ChannelResolvable} [channel] Channel to limit search to (only for guild search endpoint)