public static async Task <Model> ModifyAsync(IVoiceChannel channel, BaseDiscordClient client, Action <ModifyVoiceChannelParams> func, RequestOptions options) { var args = new ModifyVoiceChannelParams(); func(args); return(await client.ApiClient.ModifyGuildChannelAsync(channel.Id, args, options).ConfigureAwait(false)); }
public async Task ModifyAsync(Action <ModifyVoiceChannelParams> func) { if (func == null) { throw new NullReferenceException(nameof(func)); } var args = new ModifyVoiceChannelParams(); func(args); if (!args._name.IsSpecified) { args._name = Name; } var model = await Discord.ApiClient.ModifyGuildChannelAsync(Id, args).ConfigureAwait(false); Update(model, UpdateSource.Rest); }