public static async Task <IStage> ModifyStageAsync(this IRestClient client, Snowflake channelId, Action <ModifyStageActionProperties> action, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { Guard.IsNotNull(action); var properties = new ModifyStageActionProperties(); action(properties); var content = new ModifyStageInstanceJsonRestRequestContent() { Topic = properties.Topic, PrivacyLevel = properties.PrivacyLevel }; var model = await client.ApiClient.ModifyStageInstanceAsync(channelId, content, options, cancellationToken).ConfigureAwait(false); return(new TransientStage(client, model)); }
public static async Task <IStage> ModifyStageAsync(this IRestClient client, Snowflake channelId, Action <ModifyStageActionProperties> action, IRestRequestOptions options = null) { if (action == null) { throw new ArgumentNullException(nameof(action)); } var properties = new ModifyStageActionProperties(); action(properties); var content = new ModifyStageInstanceJsonRestRequestContent() { Topic = properties.Topic, PrivacyLevel = properties.PrivacyLevel }; var model = await client.ApiClient.ModifyStageInstanceAsync(channelId, content, options).ConfigureAwait(false); return(new TransientStage(client, model)); }