mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
Hotfix discord breaking changes
This commit is contained in:
@@ -282,6 +282,24 @@ export class DiscordMusicPlayerInstance {
|
||||
}, 2000);
|
||||
}
|
||||
);
|
||||
|
||||
// Hotfix for VoiceConnection stuck in signalling state around a minute
|
||||
// https://github.com/discordjs/discord.js/issues/9185
|
||||
this.voiceConnection.on('stateChange', (oldState: VoiceConnectionState, newState: VoiceConnectionState) => {
|
||||
const oldNetworking = Reflect.get(oldState, 'networking');
|
||||
const newNetworking = Reflect.get(newState, 'networking');
|
||||
|
||||
const networkStateChangeHandler = (
|
||||
oldNetworkState: VoiceConnectionState,
|
||||
newNetworkState: VoiceConnectionState
|
||||
) => {
|
||||
const newUdp = Reflect.get(newNetworkState, 'udp');
|
||||
clearInterval(newUdp?.keepAliveInterval);
|
||||
};
|
||||
|
||||
oldNetworking?.off('stateChange', networkStateChangeHandler);
|
||||
newNetworking?.on('stateChange', networkStateChangeHandler);
|
||||
});
|
||||
}
|
||||
|
||||
public async leaveVoiceChannel() {
|
||||
|
||||
Reference in New Issue
Block a user