mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Make bot/user account warnings MOAR CONSISTENT!!one!
This commit is contained in:
@@ -109,7 +109,7 @@ class Client extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of presences for friends of the logged in user.
|
* 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>}
|
* @type {Collection<string, Presence>}
|
||||||
*/
|
*/
|
||||||
this.presences = new Collection();
|
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
|
* 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.
|
* 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
|
* @param {Guild[]|Collection<string, Guild>} [guilds=this.guilds] An array or collection of guilds to sync
|
||||||
*/
|
*/
|
||||||
syncGuilds(guilds = this.guilds) {
|
syncGuilds(guilds = this.guilds) {
|
||||||
if (!this.user.bot) {
|
if (this.user.bot) return;
|
||||||
this.ws.send({
|
this.ws.send({
|
||||||
op: 12,
|
op: 12,
|
||||||
d: guilds instanceof Collection ? guilds.keyArray() : guilds.map(g => g.id),
|
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.
|
* 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
|
* @param {string} id The ID of the user to obtain
|
||||||
* @returns {Promise<User>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
@@ -328,7 +327,7 @@ class Client extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the bot's OAuth2 application.
|
* 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>}
|
* @returns {Promise<ClientOAuth2App>}
|
||||||
*/
|
*/
|
||||||
fetchApplication() {
|
fetchApplication() {
|
||||||
|
|||||||
@@ -25,21 +25,21 @@ class ClientUser extends User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A Collection of friends for the logged in 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>}
|
* @type {Collection<string, User>}
|
||||||
*/
|
*/
|
||||||
this.friends = new Collection();
|
this.friends = new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Collection of blocked users for the logged in user.
|
* 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>}
|
* @type {Collection<string, User>}
|
||||||
*/
|
*/
|
||||||
this.blocked = new Collection();
|
this.blocked = new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Collection of notes for the logged in user.
|
* 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>}
|
* @type {Collection<string, string>}
|
||||||
*/
|
*/
|
||||||
this.notes = new Collection();
|
this.notes = new Collection();
|
||||||
@@ -148,7 +148,7 @@ class ClientUser extends User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a friend request
|
* 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.
|
* @param {UserResolvable} user The user to send the friend request to.
|
||||||
* @returns {Promise<User>} The user the friend request was sent to.
|
* @returns {Promise<User>} The user the friend request was sent to.
|
||||||
*/
|
*/
|
||||||
@@ -159,7 +159,7 @@ class ClientUser extends User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a friend
|
* 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
|
* @param {UserResolvable} user The user to remove from your friends
|
||||||
* @returns {Promise<User>} The user that was removed
|
* @returns {Promise<User>} The user that was removed
|
||||||
*/
|
*/
|
||||||
@@ -170,7 +170,7 @@ class ClientUser extends User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a guild
|
* 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} name The name of the guild
|
||||||
* @param {string} region The region for the server
|
* @param {string} region The region for the server
|
||||||
* @param {BufferResolvable|Base64Resolvable} [icon=null] The icon for the guild
|
* @param {BufferResolvable|Base64Resolvable} [icon=null] The icon for the guild
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ class Guild {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Syncs this guild (already done automatically every 30 seconds).
|
* 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() {
|
sync() {
|
||||||
if (!this.client.user.bot) this.client.syncGuilds([this]);
|
if (!this.client.user.bot) this.client.syncGuilds([this]);
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The note that is set for the 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}
|
* @type {?string}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
@@ -147,7 +147,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a friend request to the 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>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
addFriend() {
|
addFriend() {
|
||||||
@@ -156,7 +156,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the user from your friends
|
* 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>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
removeFriend() {
|
removeFriend() {
|
||||||
@@ -165,7 +165,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Blocks the 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>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
block() {
|
block() {
|
||||||
@@ -174,7 +174,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unblocks the 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>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
unblock() {
|
unblock() {
|
||||||
@@ -183,6 +183,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the profile of the user
|
* Get the profile of the user
|
||||||
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @returns {Promise<UserProfile>}
|
* @returns {Promise<UserProfile>}
|
||||||
*/
|
*/
|
||||||
fetchProfile() {
|
fetchProfile() {
|
||||||
@@ -191,7 +192,7 @@ class User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a note for the 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
|
* @param {string} note The note to set for the user
|
||||||
* @returns {Promise<User>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -119,7 +119,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 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
|
* @param {string} messageID The ID of the message to get
|
||||||
* @returns {Promise<Message>}
|
* @returns {Promise<Message>}
|
||||||
* @example
|
* @example
|
||||||
@@ -302,7 +302,7 @@ class TextBasedChannel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Bulk delete given messages.
|
* 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
|
* @param {Collection<string, Message>|Message[]|number} messages Messages to delete, or number of messages to delete
|
||||||
* @returns {Promise<Collection<string, Message>>} Deleted messages
|
* @returns {Promise<Collection<string, Message>>} Deleted messages
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user