| @@ -111,5 +111,16 @@ namespace Discord | |||||
| /// A task that represents the asynchronous operation of removing a user from this thread. | /// A task that represents the asynchronous operation of removing a user from this thread. | ||||
| /// </returns> | /// </returns> | ||||
| Task RemoveUserAsync(IGuildUser user, RequestOptions options = null); | Task RemoveUserAsync(IGuildUser user, RequestOptions options = null); | ||||
| /// <summary> | |||||
| /// Modifies this thread channel. | |||||
| /// </summary> | |||||
| /// <param name="func">The delegate containing the properties to modify the channel with.</param> | |||||
| /// <param name="options">The options to be used when sending the request.</param> | |||||
| /// <returns> | |||||
| /// A task that represents the asynchronous modification operation. | |||||
| /// </returns> | |||||
| /// <seealso cref="ThreadChannelProperties"/> | |||||
| Task ModifyAsync(Action<ThreadChannelProperties> func, RequestOptions options = null); | |||||
| } | } | ||||
| } | } | ||||
| @@ -40,25 +40,10 @@ namespace Discord | |||||
| /// <exception cref="ArgumentOutOfRangeException">Thrown if the value does not fall within [0, 21600].</exception> | /// <exception cref="ArgumentOutOfRangeException">Thrown if the value does not fall within [0, 21600].</exception> | ||||
| public Optional<int> SlowModeInterval { get; set; } | public Optional<int> SlowModeInterval { get; set; } | ||||
| /// <summary> | |||||
| /// Gets or sets whether or not the thread is archived. | |||||
| /// </summary> | |||||
| public Optional<bool> Archived { get; set; } | |||||
| /// <summary> | |||||
| /// Gets or sets whether or not the thread is locked. | |||||
| /// </summary> | |||||
| public Optional<bool> Locked { get; set; } | |||||
| /// <summary> | /// <summary> | ||||
| /// Gets or sets the auto archive duration. | /// Gets or sets the auto archive duration. | ||||
| /// </summary> | /// </summary> | ||||
| public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; } | ||||
| /// <summary> | |||||
| /// Gets or sets the tags applied to a forum thread | |||||
| /// </summary> | |||||
| public Optional<IEnumerable<ulong>> AppliedTags { get; set; } | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,26 @@ | |||||
| using System.Collections.Generic; | |||||
| namespace Discord; | |||||
| /// <summary> | |||||
| /// Provides properties that are used to modify an <see cref="IThreadChannel"/> with the specified changes. | |||||
| /// </summary> | |||||
| /// <seealso cref="IThreadChannel.ModifyAsync(System.Action{ThreadChannelProperties}, RequestOptions)"/> | |||||
| public class ThreadChannelProperties : TextChannelProperties | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets or sets the tags applied to a forum thread | |||||
| /// </summary> | |||||
| public Optional<IEnumerable<ulong>> AppliedTags { get; set; } | |||||
| /// <summary> | |||||
| /// Gets or sets whether or not the thread is locked. | |||||
| /// </summary> | |||||
| public Optional<bool> Locked { get; set; } | |||||
| /// <summary> | |||||
| /// Gets or sets whether or not the thread is archived. | |||||
| /// </summary> | |||||
| public Optional<bool> Archived { get; set; } | |||||
| } | |||||
| @@ -114,6 +114,13 @@ namespace Discord.Rest | |||||
| Update(model); | Update(model); | ||||
| } | } | ||||
| /// <inheritdoc/> | |||||
| public async Task ModifyAsync(Action<ThreadChannelProperties> func, RequestOptions options = null) | |||||
| { | |||||
| var model = await ThreadHelper.ModifyAsync(this, Discord, func, options); | |||||
| Update(model); | |||||
| } | |||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// <b>This method is not supported in threads.</b> | /// <b>This method is not supported in threads.</b> | ||||
| @@ -46,10 +46,10 @@ namespace Discord.Rest | |||||
| } | } | ||||
| public static async Task<Model> ModifyAsync(IThreadChannel channel, BaseDiscordClient client, | public static async Task<Model> ModifyAsync(IThreadChannel channel, BaseDiscordClient client, | ||||
| Action<TextChannelProperties> func, | |||||
| Action<ThreadChannelProperties> func, | |||||
| RequestOptions options) | RequestOptions options) | ||||
| { | { | ||||
| var args = new TextChannelProperties(); | |||||
| var args = new ThreadChannelProperties(); | |||||
| func(args); | func(args); | ||||
| var apiArgs = new ModifyThreadParams | var apiArgs = new ModifyThreadParams | ||||
| { | { | ||||
| @@ -342,6 +342,10 @@ namespace Discord.WebSocket | |||||
| public override Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null) | public override Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null) | ||||
| => ThreadHelper.ModifyAsync(this, Discord, func, options); | => ThreadHelper.ModifyAsync(this, Discord, func, options); | ||||
| /// <inheritdoc/> | |||||
| public Task ModifyAsync(Action<ThreadChannelProperties> func, RequestOptions options = null) | |||||
| => ThreadHelper.ModifyAsync(this, Discord, func, options); | |||||
| /// <inheritdoc/> | /// <inheritdoc/> | ||||
| /// <remarks> | /// <remarks> | ||||
| /// <b>This method is not supported in threads.</b> | /// <b>This method is not supported in threads.</b> | ||||