mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 01:05:30 +01:00
Temporary workaround for VoiceConnection stuck in signalling state (#907)
This commit is contained in:
parent
f7c3d87722
commit
6926e39c56
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Fixed
|
||||||
|
- Add temporary workaround to avoid VoiceConnection being stuck in signalling state
|
||||||
|
|
||||||
## [2.2.0] - 2023-02-26
|
## [2.2.0] - 2023-02-26
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -84,6 +84,22 @@ export default class {
|
||||||
guildId: channel.guild.id,
|
guildId: channel.guild.id,
|
||||||
adapterCreator: channel.guild.voiceAdapterCreator as DiscordGatewayAdapterCreator,
|
adapterCreator: channel.guild.voiceAdapterCreator as DiscordGatewayAdapterCreator,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Workaround to disable keepAlive
|
||||||
|
this.voiceConnection.on('stateChange', (oldState, newState) => {
|
||||||
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
||||||
|
const oldNetworking = Reflect.get(oldState, 'networking');
|
||||||
|
const newNetworking = Reflect.get(newState, 'networking');
|
||||||
|
|
||||||
|
const networkStateChangeHandler = (_: any, newNetworkState: any) => {
|
||||||
|
const newUdp = Reflect.get(newNetworkState, 'udp');
|
||||||
|
clearInterval(newUdp?.keepAliveInterval);
|
||||||
|
};
|
||||||
|
|
||||||
|
oldNetworking?.off('stateChange', networkStateChangeHandler);
|
||||||
|
newNetworking?.on('stateChange', networkStateChangeHandler);
|
||||||
|
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect(): void {
|
disconnect(): void {
|
||||||
|
|
Loading…
Reference in a new issue