public static void LeaveRadioChannel(VoiceClient voiceClient, bool primary) { foreach (RadioChannelMember membership in VoiceManager.GetPlayerRadioChannelMembership(voiceClient).Where(m => m.IsPrimary == primary)) { membership.RadioChannel.RemoveMember(voiceClient); if (membership.RadioChannel.Members.Length == 0) { lock (VoiceManager._radioChannels) { VoiceManager._radioChannels.Remove(membership.RadioChannel); } } } }
public static void LeaveRadioChannel(VoiceClient voiceClient, string radioChannelName) { foreach (RadioChannelMember membership in VoiceManager.GetPlayerRadioChannelMembership(voiceClient).Where(m => m.RadioChannel.Name == radioChannelName)) { membership.RadioChannel.RemoveMember(voiceClient); if (membership.RadioChannel.Members.Length == 0) { lock (VoiceManager._radioChannels) { VoiceManager._radioChannels.Remove(membership.RadioChannel); } } } }