mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13: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;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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.token = token;
|
||||
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) {
|
||||
const promises = this.client.guilds.array().map(g => g.fetchMembers());
|
||||
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._emitReady();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user