* Add RTCRegion to voice channels * Update MockedGroupChannel.cstags/3.1.0
@@ -10,6 +10,14 @@ namespace Discord | |||||
public interface IAudioChannel : IChannel | public interface IAudioChannel : IChannel | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Gets the RTC region for this audio channel. | |||||
/// </summary> | |||||
/// <remarks> | |||||
/// This property can be <see langword="null"/>. | |||||
/// </remarks> | |||||
string RTCRegion { get; } | |||||
/// <summary> | |||||
/// Connects to this audio channel. | /// Connects to this audio channel. | ||||
/// </summary> | /// </summary> | ||||
/// <param name="selfDeaf">Determines whether the client should deaf itself upon connection.</param> | /// <param name="selfDeaf">Determines whether the client should deaf itself upon connection.</param> | ||||
@@ -40,6 +40,8 @@ namespace Discord.API | |||||
public Optional<int> Bitrate { get; set; } | public Optional<int> Bitrate { get; set; } | ||||
[JsonProperty("user_limit")] | [JsonProperty("user_limit")] | ||||
public Optional<int> UserLimit { get; set; } | public Optional<int> UserLimit { get; set; } | ||||
[JsonProperty("rtc_region")] | |||||
public Optional<string> RTCRegion { get; set; } | |||||
//PrivateChannel | //PrivateChannel | ||||
[JsonProperty("recipients")] | [JsonProperty("recipients")] | ||||
@@ -22,6 +22,8 @@ namespace Discord.Rest | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <inheritdoc/> | |||||
public string RTCRegion { get; private set; } | |||||
public IReadOnlyCollection<RestGroupUser> Users => _users.ToReadOnlyCollection(); | public IReadOnlyCollection<RestGroupUser> Users => _users.ToReadOnlyCollection(); | ||||
public IReadOnlyCollection<RestGroupUser> Recipients | public IReadOnlyCollection<RestGroupUser> Recipients | ||||
@@ -46,6 +48,8 @@ namespace Discord.Rest | |||||
if (model.Recipients.IsSpecified) | if (model.Recipients.IsSpecified) | ||||
UpdateUsers(model.Recipients.Value); | UpdateUsers(model.Recipients.Value); | ||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | |||||
} | } | ||||
internal void UpdateUsers(API.User[] models) | internal void UpdateUsers(API.User[] models) | ||||
{ | { | ||||
@@ -21,6 +21,8 @@ namespace Discord.Rest | |||||
public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public ulong? CategoryId { get; private set; } | public ulong? CategoryId { get; private set; } | ||||
/// <inheritdoc/> | |||||
public string RTCRegion { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Mention => MentionUtils.MentionChannel(Id); | public string Mention => MentionUtils.MentionChannel(Id); | ||||
@@ -46,6 +48,8 @@ namespace Discord.Rest | |||||
if(model.UserLimit.IsSpecified) | if(model.UserLimit.IsSpecified) | ||||
UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null; | UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null; | ||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -30,6 +30,9 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <inheritdoc/> | |||||
public string RTCRegion { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public IReadOnlyCollection<SocketMessage> CachedMessages => _messages?.Messages ?? ImmutableArray.Create<SocketMessage>(); | public IReadOnlyCollection<SocketMessage> CachedMessages => _messages?.Messages ?? ImmutableArray.Create<SocketMessage>(); | ||||
@@ -67,6 +70,8 @@ namespace Discord.WebSocket | |||||
if (model.Recipients.IsSpecified) | if (model.Recipients.IsSpecified) | ||||
UpdateUsers(state, model.Recipients.Value); | UpdateUsers(state, model.Recipients.Value); | ||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | |||||
} | } | ||||
private void UpdateUsers(ClientState state, UserModel[] models) | private void UpdateUsers(ClientState state, UserModel[] models) | ||||
{ | { | ||||
@@ -21,6 +21,8 @@ namespace Discord.WebSocket | |||||
public int Bitrate { get; private set; } | public int Bitrate { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
/// <inheritdoc/> | |||||
public string RTCRegion { get; private set; } | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public ulong? CategoryId { get; private set; } | public ulong? CategoryId { get; private set; } | ||||
@@ -66,6 +68,7 @@ namespace Discord.WebSocket | |||||
CategoryId = model.CategoryId; | CategoryId = model.CategoryId; | ||||
Bitrate = model.Bitrate.Value; | Bitrate = model.Bitrate.Value; | ||||
UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null; | UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null; | ||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | |||||
} | } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
@@ -16,6 +16,8 @@ namespace Discord | |||||
public ulong Id => throw new NotImplementedException(); | public ulong Id => throw new NotImplementedException(); | ||||
public string RTCRegion => throw new NotImplementedException(); | |||||
public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) | public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) | ||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
@@ -29,6 +29,8 @@ namespace Discord | |||||
public DateTimeOffset CreatedAt => throw new NotImplementedException(); | public DateTimeOffset CreatedAt => throw new NotImplementedException(); | ||||
public ulong Id => throw new NotImplementedException(); | public ulong Id => throw new NotImplementedException(); | ||||
public string RTCRegion => throw new NotImplementedException(); | |||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) | ||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||