From ece124e25286aa105492ef010648f6c23cb4af16 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Mon, 1 Apr 2019 22:41:39 -0700 Subject: [PATCH] remove the (untested) ability to change channel types --- .../Entities/Channels/TextChannelProperties.cs | 10 ---------- .../API/Rest/ModifyTextChannelParams.cs | 2 -- src/Discord.Net.Rest/DiscordRestApiClient.cs | 9 --------- .../Entities/Channels/ChannelHelper.cs | 1 - 4 files changed, 22 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs index 1beafd4e8..6dcbf860a 100644 --- a/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs +++ b/src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs @@ -38,15 +38,5 @@ namespace Discord /// /// Thrown if the value does not fall within [0, 120]. public Optional SlowModeInterval { get; set; } - - /// - /// Gets or sets the type of channel. - /// Only setting to a is supported. - /// - /// - /// Setting this value to a different type will change the type of channel that is associated with this Id. - /// - /// Thrown if the type of channel that is being set is not valid. - public Optional Type { get; set; } } } diff --git a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs index 1451ec14b..94f149fc1 100644 --- a/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs @@ -12,7 +12,5 @@ namespace Discord.API.Rest public Optional IsNsfw { get; set; } [JsonProperty("rate_limit_per_user")] public Optional SlowModeInterval { get; set; } - [JsonProperty("type")] - public Optional Type { get; set; } } } diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 842f9d75d..b1e04e9dc 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -377,15 +377,6 @@ namespace Discord.API Preconditions.NotNullOrEmpty(args.Name, nameof(args.Name)); Preconditions.AtLeast(args.SlowModeInterval, 0, nameof(args.SlowModeInterval)); Preconditions.AtMost(args.SlowModeInterval, 120, nameof(args.SlowModeInterval)); - if (args.Type.IsSpecified) - { - // can only change Text/NewsChannel into a Text or News - var warn = "You may not change a Text or News channel into a Voice, Group, DM, or Category channel."; - Preconditions.NotEqual((uint)args.Type.Value, (uint)ChannelType.Voice, nameof(args.Type), warn); - Preconditions.NotEqual((uint)args.Type.Value, (uint)ChannelType.Group, nameof(args.Type), warn); - Preconditions.NotEqual((uint)args.Type.Value, (uint)ChannelType.DM, nameof(args.Type), warn); - Preconditions.NotEqual((uint)args.Type.Value, (uint)ChannelType.Category, nameof(args.Type), warn); - } options = RequestOptions.CreateOrClone(options); var ids = new BucketIds(channelId: channelId); diff --git a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs index e2fe8969c..d8a97e85a 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs @@ -46,7 +46,6 @@ namespace Discord.Rest Topic = args.Topic, IsNsfw = args.IsNsfw, SlowModeInterval = args.SlowModeInterval, - Type = args.Type }; return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false); }