Fixed channel topics

This commit is contained in:
RogueException
2015-10-06 22:06:40 -03:00
parent c43f0d63e1
commit 81f6e5c5aa
2 changed files with 9 additions and 4 deletions

View File

@@ -109,7 +109,7 @@ namespace Discord.API
[JsonProperty("is_private")]
public bool IsPrivate;
[JsonProperty("position")]
public int Position;
public int? Position;
[JsonProperty(PropertyName = "topic")]
public string Topic;
[JsonProperty("permission_overwrites")]

View File

@@ -89,14 +89,19 @@ namespace Discord
internal void Update(API.ChannelReference model)
{
Name = model.Name;
Type = model.Type;
if (model.Name != null)
Name = model.Name;
if (model.Type != null)
Type = model.Type;
}
internal void Update(API.ChannelInfo model)
{
Update(model as API.ChannelReference);
Position = model.Position;
if (model.Position != null)
Position = model.Position.Value;
if (model.Topic != null)
Topic = model.Topic;
if (model.PermissionOverwrites != null)
{