From 510f4745ea5f6d6fe3e802249adc79945733dcb5 Mon Sep 17 00:00:00 2001
From: Still Hsu <341464@gmail.com>
Date: Sun, 22 Apr 2018 02:43:00 +0800
Subject: [PATCH] Update VoiceRegion model (#1030)
---
.../Entities/Guilds/IVoiceRegion.cs | 12 ++++++------
src/Discord.Net.Rest/API/Common/VoiceRegion.cs | 10 +++++-----
.../Entities/Guilds/RestVoiceRegion.cs | 15 ++++++++++-----
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/Discord.Net.Core/Entities/Guilds/IVoiceRegion.cs b/src/Discord.Net.Core/Entities/Guilds/IVoiceRegion.cs
index 1a76287d8..67bedbc3d 100644
--- a/src/Discord.Net.Core/Entities/Guilds/IVoiceRegion.cs
+++ b/src/Discord.Net.Core/Entities/Guilds/IVoiceRegion.cs
@@ -1,4 +1,4 @@
-namespace Discord
+namespace Discord
{
public interface IVoiceRegion
{
@@ -10,9 +10,9 @@
bool IsVip { get; }
/// Returns true if this voice region is the closest to your machine.
bool IsOptimal { get; }
- /// Gets an example hostname for this voice region.
- string SampleHostname { get; }
- /// Gets an example port for this voice region.
- int SamplePort { get; }
+ /// Returns true if this is a deprecated voice region (avoid switching to these).
+ bool IsDeprecated { get; }
+ /// Returns true if this is a custom voice region (used for events/etc)
+ bool IsCustom { get; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Discord.Net.Rest/API/Common/VoiceRegion.cs b/src/Discord.Net.Rest/API/Common/VoiceRegion.cs
index 5f31e8f64..606af07bd 100644
--- a/src/Discord.Net.Rest/API/Common/VoiceRegion.cs
+++ b/src/Discord.Net.Rest/API/Common/VoiceRegion.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#pragma warning disable CS1591
using Newtonsoft.Json;
namespace Discord.API
@@ -13,9 +13,9 @@ namespace Discord.API
public bool IsVip { get; set; }
[JsonProperty("optimal")]
public bool IsOptimal { get; set; }
- [JsonProperty("sample_hostname")]
- public string SampleHostname { get; set; }
- [JsonProperty("sample_port")]
- public int SamplePort { get; set; }
+ [JsonProperty("deprecated")]
+ public bool IsDeprecated { get; set; }
+ [JsonProperty("custom")]
+ public bool IsCustom { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestVoiceRegion.cs b/src/Discord.Net.Rest/Entities/Guilds/RestVoiceRegion.cs
index 47fd2cd19..4e0c3c1ee 100644
--- a/src/Discord.Net.Rest/Entities/Guilds/RestVoiceRegion.cs
+++ b/src/Discord.Net.Rest/Entities/Guilds/RestVoiceRegion.cs
@@ -1,4 +1,4 @@
-using Discord.Rest;
+using Discord.Rest;
using System.Diagnostics;
using Model = Discord.API.VoiceRegion;
@@ -7,11 +7,16 @@ namespace Discord
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RestVoiceRegion : RestEntity, IVoiceRegion
{
+ ///
public string Name { get; private set; }
+ ///
public bool IsVip { get; private set; }
+ ///
public bool IsOptimal { get; private set; }
- public string SampleHostname { get; private set; }
- public int SamplePort { get; private set; }
+ ///
+ public bool IsDeprecated { get; private set; }
+ ///
+ public bool IsCustom { get; private set; }
internal RestVoiceRegion(BaseDiscordClient client, string id)
: base(client, id)
@@ -28,8 +33,8 @@ namespace Discord
Name = model.Name;
IsVip = model.IsVip;
IsOptimal = model.IsOptimal;
- SampleHostname = model.SampleHostname;
- SamplePort = model.SamplePort;
+ IsDeprecated = model.IsDeprecated;
+ IsCustom = model.IsCustom;
}
public override string ToString() => Name;