Co-Authored-By: Nova Fox <novamaday@gmail.com>pull/1958/head
@@ -25,13 +25,5 @@ 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"); | |||||
} | } | ||||
} | } |
@@ -21,6 +21,9 @@ namespace Discord.Rest | |||||
if (type == ThreadType.PrivateThread && !features.HasFeature(GuildFeature.PrivateThreads)) | if (type == ThreadType.PrivateThread && !features.HasFeature(GuildFeature.PrivateThreads)) | ||||
throw new ArgumentException($"The guild {channel.Guild.Name} does not have the PRIVATE_THREADS feature!", nameof(type)); | throw new ArgumentException($"The guild {channel.Guild.Name} does not have the PRIVATE_THREADS feature!", nameof(type)); | ||||
if (channel is INewsChannel && type != ThreadType.NewsThread) | |||||
throw new ArgumentException($"{nameof(type)} must be a {ThreadType.NewsThread} in News channels"); | |||||
var args = new StartThreadParams | var args = new StartThreadParams | ||||
{ | { | ||||
Name = name, | Name = name, | ||||
@@ -36,12 +36,5 @@ namespace Discord.WebSocket | |||||
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"); | |||||
} | } | ||||
} | } |