Browse Source

Added Region.Vip

tags/docs-0.9
RogueException 9 years ago
parent
commit
c66138e59b
3 changed files with 7 additions and 3 deletions
  1. +2
    -0
      src/Discord.Net/API/Client/Rest/GetVoiceRegions.cs
  2. +2
    -2
      src/Discord.Net/DiscordClient.cs
  3. +3
    -1
      src/Discord.Net/Models/Region.cs

+ 2
- 0
src/Discord.Net/API/Client/Rest/GetVoiceRegions.cs 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; }
} }
} }

+ 2
- 2
src/Discord.Net/DiscordClient.cs 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




+ 3
- 1
src/Discord.Net/Models/Region.cs 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;
} }
} }
} }

Loading…
Cancel
Save