Make bot/user account warnings MOAR CONSISTENT!!one!

This commit is contained in:
Schuyler Cebulskie
2016-11-12 17:15:17 -05:00
parent 1e8392d90b
commit ce132d5f54
5 changed files with 25 additions and 25 deletions

View File

@@ -109,7 +109,7 @@ class Client extends EventEmitter {
/**
* A collection of presences for friends of the logged in user.
* <warn>This is only filled for user accounts, not bot accounts.</warn>
* <warn>This is only filled when using a user account.</warn>
* @type {Collection<string, Presence>}
*/
this.presences = new Collection();
@@ -247,21 +247,20 @@ class Client extends EventEmitter {
/**
* This shouldn't really be necessary to most developers as it is automatically invoked every 30 seconds, however
* if you wish to force a sync of guild data, you can use this.
* <warn>This is only applicable to user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @param {Guild[]|Collection<string, Guild>} [guilds=this.guilds] An array or collection of guilds to sync
*/
syncGuilds(guilds = this.guilds) {
if (!this.user.bot) {
this.ws.send({
op: 12,
d: guilds instanceof Collection ? guilds.keyArray() : guilds.map(g => g.id),
});
}
if (this.user.bot) return;
this.ws.send({
op: 12,
d: guilds instanceof Collection ? guilds.keyArray() : guilds.map(g => g.id),
});
}
/**
* Caches a user, or obtains it from the cache if it's already cached.
* <warn>This is only available to bot accounts.</warn>
* <warn>This is only available when using a bot account.</warn>
* @param {string} id The ID of the user to obtain
* @returns {Promise<User>}
*/
@@ -328,7 +327,7 @@ class Client extends EventEmitter {
/**
* Gets the bot's OAuth2 application.
* <warn>This is only available for bot accounts.</warn>
* <warn>This is only available when using a bot account.</warn>
* @returns {Promise<ClientOAuth2App>}
*/
fetchApplication() {

View File

@@ -25,21 +25,21 @@ class ClientUser extends User {
/**
* A Collection of friends for the logged in user.
* <warn>This is only filled for user accounts, not bot accounts.</warn>
* <warn>This is only filled when using a user account.</warn>
* @type {Collection<string, User>}
*/
this.friends = new Collection();
/**
* A Collection of blocked users for the logged in user.
* <warn>This is only filled for user accounts, not bot accounts.</warn>
* <warn>This is only filled when using a user account.</warn>
* @type {Collection<string, User>}
*/
this.blocked = new Collection();
/**
* A Collection of notes for the logged in user.
* <warn>This is only filled for user accounts, not bot accounts.</warn>
* <warn>This is only filled when using a user account.</warn>
* @type {Collection<string, string>}
*/
this.notes = new Collection();
@@ -148,7 +148,7 @@ class ClientUser extends User {
/**
* Send a friend request
* <warn>This is only available for user accounts, not bot accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @param {UserResolvable} user The user to send the friend request to.
* @returns {Promise<User>} The user the friend request was sent to.
*/
@@ -159,7 +159,7 @@ class ClientUser extends User {
/**
* Remove a friend
* <warn>This is only available for user accounts, not bot accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @param {UserResolvable} user The user to remove from your friends
* @returns {Promise<User>} The user that was removed
*/
@@ -170,7 +170,7 @@ class ClientUser extends User {
/**
* Creates a guild
* <warn>This is only available for user accounts, not bot accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @param {string} name The name of the guild
* @param {string} region The region for the server
* @param {BufferResolvable|Base64Resolvable} [icon=null] The icon for the guild

View File

@@ -539,7 +539,7 @@ class Guild {
/**
* Syncs this guild (already done automatically every 30 seconds).
* <warn>This is only applicable to user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
*/
sync() {
if (!this.client.user.bot) this.client.syncGuilds([this]);

View File

@@ -99,7 +99,7 @@ class User {
/**
* The note that is set for the user
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @type {?string}
* @readonly
*/
@@ -147,7 +147,7 @@ class User {
/**
* Sends a friend request to the user
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<User>}
*/
addFriend() {
@@ -156,7 +156,7 @@ class User {
/**
* Removes the user from your friends
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<User>}
*/
removeFriend() {
@@ -165,7 +165,7 @@ class User {
/**
* Blocks the user
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<User>}
*/
block() {
@@ -174,7 +174,7 @@ class User {
/**
* Unblocks the user
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<User>}
*/
unblock() {
@@ -183,6 +183,7 @@ class User {
/**
* Get the profile of the user
* <warn>This is only available when using a user account.</warn>
* @returns {Promise<UserProfile>}
*/
fetchProfile() {
@@ -191,7 +192,7 @@ class User {
/**
* Sets a note for the user
* <warn>This is only available for user accounts.</warn>
* <warn>This is only available when using a user account.</warn>
* @param {string} note The note to set for the user
* @returns {Promise<User>}
*/

View File

@@ -119,7 +119,7 @@ class TextBasedChannel {
/**
* Gets a single message from this channel, regardless of it being cached or not.
* <warn>This is only available for bot accounts.</warn>
* <warn>This is only available when using a bot account.</warn>
* @param {string} messageID The ID of the message to get
* @returns {Promise<Message>}
* @example
@@ -302,7 +302,7 @@ class TextBasedChannel {
/**
* Bulk delete given messages.
* <warn>This is only available for bot accounts.</warn>
* <warn>This is only available when using a bot account.</warn>
* @param {Collection<string, Message>|Message[]|number} messages Messages to delete, or number of messages to delete
* @returns {Promise<Collection<string, Message>>} Deleted messages
*/