Browse Source

Added Region.Vip

pull/22/merge
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; }
[JsonProperty("name")]
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
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);
break;
}
@@ -424,7 +424,7 @@ namespace Discord
if (_regions.TryGetValue(id, out region))
return region;
else
return new Region(id, id, "", 0);
return new Region(id, id, "", 0, false);
}
#endregion



+ 3
- 1
src/Discord.Net/Models/Region.cs View File

@@ -6,13 +6,15 @@
public string Name { get; }
public string Hostname { 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;
Name = name;
Hostname = hostname;
Port = port;
Vip = vip;
}
}
}

Loading…
Cancel
Save