voice: pass joinConfig.group to getVoiceConnection (#7442)

This commit is contained in:
CallMe AsYouFeel
2022-02-12 18:22:25 +09:00
committed by GitHub
parent 55b388a763
commit fa97a31504
2 changed files with 13 additions and 13 deletions

View File

@@ -533,7 +533,7 @@ export class VoiceConnection extends TypedEmitter<VoiceConnectionEvents> {
if (this.state.status === VoiceConnectionStatus.Destroyed) {
throw new Error('Cannot destroy VoiceConnection - it has already been destroyed');
}
if (getVoiceConnection(this.joinConfig.guildId) === this) {
if (getVoiceConnection(this.joinConfig.guildId, this.joinConfig.group) === this) {
untrackVoiceConnection(this);
}
if (adapterAvailable) {
@@ -692,7 +692,7 @@ export class VoiceConnection extends TypedEmitter<VoiceConnectionEvents> {
*/
export function createVoiceConnection(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {
const payload = createJoinVoiceChannelPayload(joinConfig);
const existing = getVoiceConnection(joinConfig.guildId);
const existing = getVoiceConnection(joinConfig.guildId, joinConfig.group);
if (existing && existing.state.status !== VoiceConnectionStatus.Destroyed) {
if (existing.state.status === VoiceConnectionStatus.Disconnected) {
existing.rejoin({