Remove past-tense naming on shard events

This commit is contained in:
Schuyler Cebulskie
2019-08-31 17:14:48 -04:00
parent 9e6a73d1a0
commit 4b34f1acbe
3 changed files with 6 additions and 6 deletions

View File

@@ -205,11 +205,11 @@ class WebSocketManager extends EventEmitter {
if (event.code === 1000 ? this.destroyed : UNRECOVERABLE_CLOSE_CODES.includes(event.code)) {
/**
* Emitted when a shard's WebSocket disconnects and will no longer reconnect.
* @event Client#shardDisconnected
* @event Client#shardDisconnect
* @param {CloseEvent} event The WebSocket close event
* @param {number} id The shard ID that disconnected
*/
this.client.emit(Events.SHARD_DISCONNECTED, event, shard.id);
this.client.emit(Events.SHARD_DISCONNECT, event, shard.id);
this.debug(WSCodes[event.code], shard);
return;
}

View File

@@ -6,9 +6,9 @@ module.exports = (client, packet, shard) => {
const replayed = shard.sequence - shard.closeSequence;
/**
* Emitted when a shard resumes successfully.
* @event Client#shardResumed
* @event Client#shardResume
* @param {number} id The shard ID that resumed
* @param {number} replayedEvents The amount of replayed events
*/
client.emit(Events.SHARD_RESUMED, shard.id, replayed);
client.emit(Events.SHARD_RESUME, shard.id, replayed);
};

View File

@@ -264,11 +264,11 @@ exports.Events = {
ERROR: 'error',
WARN: 'warn',
DEBUG: 'debug',
SHARD_DISCONNECTED: 'shardDisconnected',
SHARD_DISCONNECT: 'shardDisconnect',
SHARD_ERROR: 'shardError',
SHARD_RECONNECTING: 'shardReconnecting',
SHARD_READY: 'shardReady',
SHARD_RESUMED: 'shardResumed',
SHARD_RESUME: 'shardResume',
INVALIDATED: 'invalidated',
RAW: 'raw',
};