public async Task SetUserVoiceSettingsAsync(ulong userId, Action <UserVoiceProperties> func, RequestOptions options = null) { if (func == null) { throw new NullReferenceException(nameof(func)); } var settings = new UserVoiceProperties(); func(settings); var model = new API.Rpc.UserVoiceSettings { Mute = settings.Mute, UserId = settings.UserId, Volume = settings.Volume }; if (settings.Pan.IsSpecified) { model.Pan = settings.Pan.Value.ToModel(); } await ApiClient.SetUserVoiceSettingsAsync(userId, model, options).ConfigureAwait(false); }
public async Task SetUserVoiceSettingsAsync(ulong userId, API.Rpc.UserVoiceSettings settings, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); settings.UserId = userId; await SendRpcAsync <API.Rpc.UserVoiceSettings>("SET_USER_VOICE_SETTINGS", settings, options : options).ConfigureAwait(false); }