Added Region.Vip

This commit is contained in:
RogueException
2016-01-09 17:26:15 -04:00
parent 3b9729cb4d
commit c66138e59b
3 changed files with 7 additions and 3 deletions

View File

@@ -21,5 +21,7 @@ namespace Discord.API.Client.Rest
public string Id { get; set; } public string Id { get; set; }
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("vip")]
public bool Vip { get; set; }
} }
} }

View File

@@ -259,7 +259,7 @@ namespace Discord
//Cache other stuff //Cache other stuff
var regionsResponse = (await ClientAPI.Send(new GetVoiceRegionsRequest()).ConfigureAwait(false)); var regionsResponse = (await ClientAPI.Send(new GetVoiceRegionsRequest()).ConfigureAwait(false));
_regions = regionsResponse.Select(x => new Region(x.Id, x.Name, x.Hostname, x.Port)) _regions = regionsResponse.Select(x => new Region(x.Id, x.Name, x.Hostname, x.Port, x.Vip))
.ToDictionary(x => x.Id); .ToDictionary(x => x.Id);
break; break;
} }
@@ -424,7 +424,7 @@ namespace Discord
if (_regions.TryGetValue(id, out region)) if (_regions.TryGetValue(id, out region))
return region; return region;
else else
return new Region(id, id, "", 0); return new Region(id, id, "", 0, false);
} }
#endregion #endregion

View File

@@ -6,13 +6,15 @@
public string Name { get; } public string Name { get; }
public string Hostname { get; } public string Hostname { get; }
public int Port { get; } public int Port { get; }
public bool Vip { get; }
internal Region(string id, string name, string hostname, int port) internal Region(string id, string name, string hostname, int port, bool vip)
{ {
Id = id; Id = id;
Name = name; Name = name;
Hostname = hostname; Hostname = hostname;
Port = port; Port = port;
Vip = vip;
} }
} }
} }