From a9a951a5b331e35fe44ed7b9b8fee55e26626158 Mon Sep 17 00:00:00 2001 From: Jedimaster4559 Date: Sat, 24 Nov 2018 00:27:16 -0600 Subject: [PATCH] Added ability to specify position when creating a channel --- src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs | 2 ++ src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs index 05cdf4b8a..a102bd38d 100644 --- a/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs +++ b/src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs @@ -12,6 +12,8 @@ namespace Discord.API.Rest public ChannelType Type { get; } [JsonProperty("parent_id")] public Optional CategoryId { get; set; } + [JsonProperty("position")] + public Optional Position { get; set; } //Text channels [JsonProperty("topic")] diff --git a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs index c31fa89f2..58922213e 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs @@ -163,6 +163,7 @@ namespace Discord.Rest CategoryId = props.CategoryId, Topic = props.Topic, IsNsfw = props.IsNsfw, + Position = props.Position }; var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false); return RestTextChannel.Create(client, guild, model); @@ -180,7 +181,8 @@ namespace Discord.Rest { CategoryId = props.CategoryId, Bitrate = props.Bitrate, - UserLimit = props.UserLimit + UserLimit = props.UserLimit, + Position = props.Position }; var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false); return RestVoiceChannel.Create(client, guild, model);