Add RTCRegion to voice channels (#2002)

* Add RTCRegion to voice channels

* Update MockedGroupChannel.cs
This commit is contained in:
Quin Lynch
2021-12-24 15:57:51 -04:00
committed by GitHub
parent 144741e7c4
commit 2a416a355c
8 changed files with 30 additions and 0 deletions

View File

@@ -30,6 +30,9 @@ namespace Discord.WebSocket
/// <inheritdoc />
public string Name { get; private set; }
/// <inheritdoc/>
public string RTCRegion { get; private set; }
/// <inheritdoc />
public IReadOnlyCollection<SocketMessage> CachedMessages => _messages?.Messages ?? ImmutableArray.Create<SocketMessage>();
@@ -67,6 +70,8 @@ namespace Discord.WebSocket
if (model.Recipients.IsSpecified)
UpdateUsers(state, model.Recipients.Value);
RTCRegion = model.RTCRegion.GetValueOrDefault(null);
}
private void UpdateUsers(ClientState state, UserModel[] models)
{

View File

@@ -21,6 +21,8 @@ namespace Discord.WebSocket
public int Bitrate { get; private set; }
/// <inheritdoc />
public int? UserLimit { get; private set; }
/// <inheritdoc/>
public string RTCRegion { get; private set; }
/// <inheritdoc />
public ulong? CategoryId { get; private set; }
@@ -66,6 +68,7 @@ namespace Discord.WebSocket
CategoryId = model.CategoryId;
Bitrate = model.Bitrate.Value;
UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null;
RTCRegion = model.RTCRegion.GetValueOrDefault(null);
}
/// <inheritdoc />