| @@ -25,5 +25,13 @@ namespace Discord.Rest | |||||
| return entity; | return entity; | ||||
| } | } | ||||
| public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode."); | public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode."); | ||||
| /// <summary> | |||||
| /// <b>News channels do not support thread creation with bots.</b> | |||||
| /// </summary> | |||||
| /// <inheritdoc/> | |||||
| /// <exception cref="NotSupportedException"></exception> | |||||
| public override Task<RestThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | |||||
| => throw new NotSupportedException("Cannot create threads in News channels"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -270,7 +270,7 @@ namespace Discord.Rest | |||||
| /// <returns> | /// <returns> | ||||
| /// A task that represents the asynchronous create operation. The task result contains a <see cref="IThreadChannel"/> | /// A task that represents the asynchronous create operation. The task result contains a <see cref="IThreadChannel"/> | ||||
| /// </returns> | /// </returns> | ||||
| public async Task<RestThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, | |||||
| public virtual async Task<RestThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, | |||||
| ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | ||||
| { | { | ||||
| var model = await ThreadHelper.CreateThreadAsync(Discord, this, name, type, autoArchiveDuration, message, invitable, slowmode, options); | var model = await ThreadHelper.CreateThreadAsync(Discord, this, name, type, autoArchiveDuration, message, invitable, slowmode, options); | ||||
| @@ -35,5 +35,13 @@ namespace Discord.WebSocket | |||||
| /// </remarks> | /// </remarks> | ||||
| public override int SlowModeInterval | public override int SlowModeInterval | ||||
| => throw new NotSupportedException("News channels do not support Slow Mode."); | => throw new NotSupportedException("News channels do not support Slow Mode."); | ||||
| /// <summary> | |||||
| /// <b>News channels do not support thread creation with bots.</b> | |||||
| /// </summary> | |||||
| /// <inheritdoc/> | |||||
| /// <exception cref="NotSupportedException"></exception> | |||||
| public override Task<SocketThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | |||||
| => throw new NotSupportedException("Cannot create threads in News channels"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -112,7 +112,7 @@ namespace Discord.WebSocket | |||||
| /// <returns> | /// <returns> | ||||
| /// A task that represents the asynchronous create operation. The task result contains a <see cref="IThreadChannel"/> | /// A task that represents the asynchronous create operation. The task result contains a <see cref="IThreadChannel"/> | ||||
| /// </returns> | /// </returns> | ||||
| public async Task<SocketThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, | |||||
| public virtual async Task<SocketThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, | |||||
| ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) | ||||
| { | { | ||||
| var model = await ThreadHelper.CreateThreadAsync(Discord, this, name, type, autoArchiveDuration, message, invitable, slowmode, options); | var model = await ThreadHelper.CreateThreadAsync(Discord, this, name, type, autoArchiveDuration, message, invitable, slowmode, options); | ||||