Move and improve debug/warn docs

This commit is contained in:
Schuyler Cebulskie
2016-09-19 05:11:35 -04:00
parent 6a94658dd7
commit 47d873a8ca
4 changed files with 13 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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();
});