mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Fix stacked heartbeats on reconnect and fix documentation
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -30,11 +30,4 @@ class UserUpdateAction extends Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Emitted whenever a detail of the logged in User changes - e.g. username.
|
|
||||||
* @event Client#userUpdate
|
|
||||||
* @param {ClientUser} oldClientUser The client user before the update.
|
|
||||||
* @param {ClientUser} newClientUser The client user after the update.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = UserUpdateAction;
|
module.exports = UserUpdateAction;
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ class WebSocketManager extends EventEmitter {
|
|||||||
* Emitted whenever the client websocket is disconnected
|
* Emitted whenever the client websocket is disconnected
|
||||||
* @event Client#disconnect
|
* @event Client#disconnect
|
||||||
*/
|
*/
|
||||||
|
clearInterval(this.client.manager.heartbeatInterval);
|
||||||
if (!this.reconnecting) this.client.emit(Constants.Events.DISCONNECT);
|
if (!this.reconnecting) this.client.emit(Constants.Events.DISCONNECT);
|
||||||
if (event.code === 4004) return;
|
if (event.code === 4004) return;
|
||||||
if (event.code === 4010) return;
|
if (event.code === 4010) return;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PresenceUpdateHandler extends AbstractHandler {
|
|||||||
const oldUser = cloneObject(user);
|
const oldUser = cloneObject(user);
|
||||||
user.patch(data.user);
|
user.patch(data.user);
|
||||||
if (!user.equals(oldUser)) {
|
if (!user.equals(oldUser)) {
|
||||||
client.emit(Constants.Events.USER_DETAILS_UPDATE, oldUser, user);
|
client.emit(Constants.Events.USER_UPDATE, oldUser, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guild) {
|
if (guild) {
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ exports.Events = {
|
|||||||
MESSAGE_BULK_DELETE: 'messageDeleteBulk',
|
MESSAGE_BULK_DELETE: 'messageDeleteBulk',
|
||||||
USER_UPDATE: 'userUpdate',
|
USER_UPDATE: 'userUpdate',
|
||||||
PRESENCE_UPDATE: 'presenceUpdate',
|
PRESENCE_UPDATE: 'presenceUpdate',
|
||||||
USER_DETAILS_UPDATE: 'userUpdate',
|
|
||||||
VOICE_STATE_UPDATE: 'voiceStateUpdate',
|
VOICE_STATE_UPDATE: 'voiceStateUpdate',
|
||||||
TYPING_START: 'typingStart',
|
TYPING_START: 'typingStart',
|
||||||
TYPING_STOP: 'typingStop',
|
TYPING_STOP: 'typingStop',
|
||||||
|
|||||||
Reference in New Issue
Block a user