Added Voice Channel user_limit

This commit is contained in:
RogueException
2016-05-19 10:04:59 -03:00
parent 4aba51f2fd
commit c6c18bcf47
4 changed files with 12 additions and 0 deletions

View File

@@ -23,10 +23,16 @@ namespace Discord.API
public int Position { get; set; }
[JsonProperty("permission_overwrites")]
public Overwrite[] PermissionOverwrites { get; set; }
//TextChannel
[JsonProperty("topic")]
public string Topic { get; set; }
//VoiceChannel
[JsonProperty("bitrate")]
public int Bitrate { get; set; }
[JsonProperty("user_limit")]
public int UserLimit { get; set; }
//DMChannel
[JsonProperty("recipient")]

View File

@@ -235,6 +235,7 @@ namespace Discord.API
Preconditions.NotEqual(channelId, 0, nameof(channelId));
Preconditions.NotNull(args, nameof(args));
Preconditions.GreaterThan(args.Bitrate, 0, nameof(args.Bitrate));
Preconditions.AtLeast(args.UserLimit, 0, nameof(args.Bitrate));
Preconditions.AtLeast(args.Position, 0, nameof(args.Position));
Preconditions.NotNullOrEmpty(args.Name, nameof(args.Name));

View File

@@ -6,5 +6,7 @@ namespace Discord.API.Rest
{
[JsonProperty("bitrate")]
public Optional<int> Bitrate { get; set; }
[JsonProperty("user_limit")]
public Optional<int> UserLimit { get; set; }
}
}

View File

@@ -12,6 +12,8 @@ namespace Discord.Rest
{
/// <inheritdoc />
public int Bitrate { get; private set; }
/// <inheritdoc />
public int UserLimit { get; private set; }
internal VoiceChannel(Guild guild, Model model)
: base(guild, model)
@@ -21,6 +23,7 @@ namespace Discord.Rest
{
base.Update(model);
Bitrate = model.Bitrate;
UserLimit = model.UserLimit;
}
/// <inheritdoc />