Browse Source

Added ability to specify position when creating a channel

pull/1196/head
Jedimaster4559 6 years ago
parent
commit
a9a951a5b3
2 changed files with 5 additions and 1 deletions
  1. +2
    -0
      src/Discord.Net.Rest/API/Rest/CreateGuildChannelParams.cs
  2. +3
    -1
      src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs

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

@@ -12,6 +12,8 @@ namespace Discord.API.Rest
public ChannelType Type { get; }
[JsonProperty("parent_id")]
public Optional<ulong?> CategoryId { get; set; }
[JsonProperty("position")]
public Optional<int> Position { get; set; }

//Text channels
[JsonProperty("topic")]


+ 3
- 1
src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs View File

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


Loading…
Cancel
Save