Update VoiceRegion model (#1030)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
namespace Discord
|
namespace Discord
|
||||||
{
|
{
|
||||||
public interface IVoiceRegion
|
public interface IVoiceRegion
|
||||||
{
|
{
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
bool IsVip { get; }
|
bool IsVip { get; }
|
||||||
/// <summary> Returns true if this voice region is the closest to your machine. </summary>
|
/// <summary> Returns true if this voice region is the closest to your machine. </summary>
|
||||||
bool IsOptimal { get; }
|
bool IsOptimal { get; }
|
||||||
/// <summary> Gets an example hostname for this voice region. </summary>
|
/// <summary> Returns true if this is a deprecated voice region (avoid switching to these). </summary>
|
||||||
string SampleHostname { get; }
|
bool IsDeprecated { get; }
|
||||||
/// <summary> Gets an example port for this voice region. </summary>
|
/// <summary> Returns true if this is a custom voice region (used for events/etc) </summary>
|
||||||
int SamplePort { get; }
|
bool IsCustom { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Discord.API
|
namespace Discord.API
|
||||||
@@ -13,9 +13,9 @@ namespace Discord.API
|
|||||||
public bool IsVip { get; set; }
|
public bool IsVip { get; set; }
|
||||||
[JsonProperty("optimal")]
|
[JsonProperty("optimal")]
|
||||||
public bool IsOptimal { get; set; }
|
public bool IsOptimal { get; set; }
|
||||||
[JsonProperty("sample_hostname")]
|
[JsonProperty("deprecated")]
|
||||||
public string SampleHostname { get; set; }
|
public bool IsDeprecated { get; set; }
|
||||||
[JsonProperty("sample_port")]
|
[JsonProperty("custom")]
|
||||||
public int SamplePort { get; set; }
|
public bool IsCustom { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Discord.Rest;
|
using Discord.Rest;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Model = Discord.API.VoiceRegion;
|
using Model = Discord.API.VoiceRegion;
|
||||||
|
|
||||||
@@ -7,11 +7,16 @@ namespace Discord
|
|||||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||||
public class RestVoiceRegion : RestEntity<string>, IVoiceRegion
|
public class RestVoiceRegion : RestEntity<string>, IVoiceRegion
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsVip { get; private set; }
|
public bool IsVip { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
public bool IsOptimal { get; private set; }
|
public bool IsOptimal { get; private set; }
|
||||||
public string SampleHostname { get; private set; }
|
/// <inheritdoc />
|
||||||
public int SamplePort { get; private set; }
|
public bool IsDeprecated { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
|
public bool IsCustom { get; private set; }
|
||||||
|
|
||||||
internal RestVoiceRegion(BaseDiscordClient client, string id)
|
internal RestVoiceRegion(BaseDiscordClient client, string id)
|
||||||
: base(client, id)
|
: base(client, id)
|
||||||
@@ -28,8 +33,8 @@ namespace Discord
|
|||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
IsVip = model.IsVip;
|
IsVip = model.IsVip;
|
||||||
IsOptimal = model.IsOptimal;
|
IsOptimal = model.IsOptimal;
|
||||||
SampleHostname = model.SampleHostname;
|
IsDeprecated = model.IsDeprecated;
|
||||||
SamplePort = model.SamplePort;
|
IsCustom = model.IsCustom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() => Name;
|
public override string ToString() => Name;
|
||||||
|
|||||||
Reference in New Issue
Block a user