public static Task ReorderChannelsAsync(this IRestClient client, Snowflake guildId, IReadOnlyDictionary <Snowflake, int> positions, IRestRequestOptions options = null) { if (positions == null) { throw new ArgumentNullException(nameof(positions)); } var contents = positions.Select(x => new ReorderJsonRestRequestContent { Id = x.Key, Position = x.Value }).ToArray(); var content = new JsonObjectRestRequestContent <ReorderJsonRestRequestContent[]>(contents); return(client.ApiClient.ReorderGuildChannelsAsync(guildId, content, options)); }
public static Task ReorderChannelsAsync(this IRestClient client, Snowflake guildId, IReadOnlyDictionary <Snowflake, int> positions, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { Guard.IsNotNull(positions); var contents = positions.Select(x => new ReorderJsonRestRequestContent { Id = x.Key, Position = x.Value }).ToArray(); var content = new JsonObjectRestRequestContent <ReorderJsonRestRequestContent[]>(contents); return(client.ApiClient.ReorderGuildChannelsAsync(guildId, content, options, cancellationToken)); }