mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
Move and improve debug/warn docs
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -270,3 +270,15 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Client;
|
module.exports = Client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted for general warnings
|
||||||
|
* @event Client#warn
|
||||||
|
* @param {string} The warning
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted for general debugging information
|
||||||
|
* @event Client#debug
|
||||||
|
* @param {string} The debug information
|
||||||
|
*/
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ class ClientManager {
|
|||||||
* @param {function} reject Function to run when connection fails
|
* @param {function} reject Function to run when connection fails
|
||||||
*/
|
*/
|
||||||
connectToWebSocket(token, resolve, reject) {
|
connectToWebSocket(token, resolve, reject) {
|
||||||
/**
|
|
||||||
* Emitted when there is debug information
|
|
||||||
* @event Client#debug
|
|
||||||
*/
|
|
||||||
this.client.emit(Constants.Events.DEBUG, `Authenticated using token ${token}`);
|
this.client.emit(Constants.Events.DEBUG, `Authenticated using token ${token}`);
|
||||||
this.client.token = token;
|
this.client.token = token;
|
||||||
const timeout = this.client.setTimeout(() => reject(new Error(Constants.Errors.TOOK_TOO_LONG)), 1000 * 300);
|
const timeout = this.client.setTimeout(() => reject(new Error(Constants.Errors.TOOK_TOO_LONG)), 1000 * 300);
|
||||||
|
|||||||
@@ -234,10 +234,6 @@ class WebSocketManager {
|
|||||||
if (this.client.options.fetch_all_members) {
|
if (this.client.options.fetch_all_members) {
|
||||||
const promises = this.client.guilds.array().map(g => g.fetchMembers());
|
const promises = this.client.guilds.array().map(g => g.fetchMembers());
|
||||||
Promise.all(promises).then(() => this._emitReady()).catch(e => {
|
Promise.all(promises).then(() => this._emitReady()).catch(e => {
|
||||||
/**
|
|
||||||
* Emitted when there is a warning
|
|
||||||
* @event Client#warn
|
|
||||||
*/
|
|
||||||
this.client.emit(Constants.Event.WARN, `Error on pre-ready guild member fetching - ${e}`);
|
this.client.emit(Constants.Event.WARN, `Error on pre-ready guild member fetching - ${e}`);
|
||||||
this._emitReady();
|
this._emitReady();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user