mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: add some more consistency (#3842)
* cleanup(StreamDispatcher): remove old 'end' event * fix(StreamDispatcher): only listen to finish event once * refactor(VoiceWebSocket): use `connection.client` in favour of `connection.voiceManager.client` * fix(VoiceWebSocket): use `client.clearInterval` in favour of `clearInterval` * refactor: destructure EventEmitter * refactor: destructure EventEmitter from events * refactor: use EventEmitter.off in favour of EventEmitter.removeListener * style: order typings alphabetically * oops * fix indent * style: alphabetically organize imports * style: remove extra line * Revert "style: remove extra line" This reverts commit96e182ed69. * Revert "style: alphabetically organize imports" This reverts commit02aee9b06d. * Revert "refactor: destructure EventEmitter from events" This reverts commit9953b4d267. * Revert "refactor: destructure EventEmitter" This reverts commit930d7751ab. * Revert "fix(StreamDispatcher): only listen to finish event once" This reverts commit485a6430a8. * refactor: use .removeListener instead of .off
This commit is contained in:
@@ -175,11 +175,11 @@ class WebSocketShard extends EventEmitter {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const cleanup = () => {
|
||||
this.off(ShardEvents.CLOSE, onClose);
|
||||
this.off(ShardEvents.READY, onReady);
|
||||
this.off(ShardEvents.RESUMED, onResumed);
|
||||
this.off(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed);
|
||||
this.off(ShardEvents.DESTROYED, onInvalidOrDestroyed);
|
||||
this.removeListener(ShardEvents.CLOSE, onClose);
|
||||
this.removeListener(ShardEvents.READY, onReady);
|
||||
this.removeListener(ShardEvents.RESUMED, onResumed);
|
||||
this.removeListener(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed);
|
||||
this.removeListener(ShardEvents.DESTROYED, onInvalidOrDestroyed);
|
||||
};
|
||||
|
||||
const onReady = () => {
|
||||
|
||||
Reference in New Issue
Block a user