Browse Source

remove the (untested) ability to change channel types

pull/1293/head
Chris Johnston 6 years ago
parent
commit
ece124e252
4 changed files with 0 additions and 22 deletions
  1. +0
    -10
      src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs
  2. +0
    -2
      src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs
  3. +0
    -9
      src/Discord.Net.Rest/DiscordRestApiClient.cs
  4. +0
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 0
- 10
src/Discord.Net.Core/Entities/Channels/TextChannelProperties.cs View File

@@ -38,15 +38,5 @@ namespace Discord
/// </remarks>
/// <exception cref="ArgumentOutOfRangeException">Thrown if the value does not fall within [0, 120].</exception>
public Optional<int> SlowModeInterval { get; set; }

/// <summary>
/// Gets or sets the type of channel.
/// Only setting to a <see cref="ChannelType.News"/> is supported.
/// </summary>
/// <remarks>
/// Setting this value to a different type will change the type of channel that is associated with this Id.
/// </remarks>
/// <exception cref="ArgumentException">Thrown if the type of channel that is being set is not valid.</exception>
public Optional<ChannelType> Type { get; set; }
}
}

+ 0
- 2
src/Discord.Net.Rest/API/Rest/ModifyTextChannelParams.cs View File

@@ -12,7 +12,5 @@ namespace Discord.API.Rest
public Optional<bool> IsNsfw { get; set; }
[JsonProperty("rate_limit_per_user")]
public Optional<int> SlowModeInterval { get; set; }
[JsonProperty("type")]
public Optional<ChannelType> Type { get; set; }
}
}

+ 0
- 9
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -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);


+ 0
- 1
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

@@ -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);
}


Loading…
Cancel
Save