* add missing properties * forgot about `MockedVoiceChannel`pull/2585/head
@@ -26,6 +26,11 @@ namespace Discord | |||||
/// </returns> | /// </returns> | ||||
int? UserLimit { get; } | int? UserLimit { get; } | ||||
/// <summary> | |||||
/// Gets the video quality mode for this channel. | |||||
/// </summary> | |||||
VideoQualityMode VideoQualityMode { get; } | |||||
/// <summary> | /// <summary> | ||||
/// Bulk-deletes multiple messages. | /// Bulk-deletes multiple messages. | ||||
/// </summary> | /// </summary> | ||||
@@ -0,0 +1,17 @@ | |||||
namespace Discord; | |||||
/// <summary> | |||||
/// Represents a video quality mode for voice channels. | |||||
/// </summary> | |||||
public enum VideoQualityMode | |||||
{ | |||||
/// <summary> | |||||
/// Discord chooses the quality for optimal performance. | |||||
/// </summary> | |||||
Auto = 1, | |||||
/// <summary> | |||||
/// 720p. | |||||
/// </summary> | |||||
Full = 2 | |||||
} |
@@ -17,5 +17,10 @@ namespace Discord | |||||
/// Gets or sets the channel voice region id, automatic when set to <see langword="null"/>. | /// Gets or sets the channel voice region id, automatic when set to <see langword="null"/>. | ||||
/// </summary> | /// </summary> | ||||
public Optional<string> RTCRegion { get; set; } | public Optional<string> RTCRegion { get; set; } | ||||
/// <summary> | |||||
/// Get or sets the video quality mode for this channel. | |||||
/// </summary> | |||||
public Optional<VideoQualityMode> VideoQualityMode { get; set; } | |||||
} | } | ||||
} | } |
@@ -43,6 +43,9 @@ namespace Discord.API | |||||
[JsonProperty("rtc_region")] | [JsonProperty("rtc_region")] | ||||
public Optional<string> RTCRegion { get; set; } | public Optional<string> RTCRegion { get; set; } | ||||
[JsonProperty("video_quality_mode")] | |||||
public Optional<VideoQualityMode> VideoQualityMode { get; set; } | |||||
//PrivateChannel | //PrivateChannel | ||||
[JsonProperty("recipients")] | [JsonProperty("recipients")] | ||||
public Optional<User[]> Recipients { get; set; } | public Optional<User[]> Recipients { get; set; } | ||||
@@ -31,6 +31,10 @@ namespace Discord.API.Rest | |||||
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("video_quality_mode")] | |||||
public Optional<VideoQualityMode> VideoQuality { get; set; } | |||||
[JsonProperty("rtc_region")] | |||||
public Optional<string> RtcRegion { get; set; } | |||||
//Forum channels | //Forum channels | ||||
[JsonProperty("default_reaction_emoji")] | [JsonProperty("default_reaction_emoji")] | ||||
@@ -26,6 +26,8 @@ namespace Discord.Rest | |||||
public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public string RTCRegion { get; private set; } | public string RTCRegion { get; private set; } | ||||
/// <inheritdoc/> | |||||
public VideoQualityMode VideoQualityMode { get; private set; } | |||||
internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | internal RestVoiceChannel(BaseDiscordClient discord, IGuild guild, ulong id) | ||||
: base(discord, guild, id) | : base(discord, guild, id) | ||||
@@ -48,6 +50,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; | ||||
VideoQualityMode = model.VideoQualityMode.GetValueOrDefault(VideoQualityMode.Auto); | |||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | RTCRegion = model.RTCRegion.GetValueOrDefault(null); | ||||
} | } | ||||
@@ -285,6 +285,8 @@ namespace Discord.Rest | |||||
Deny = overwrite.Permissions.DenyValue.ToString() | Deny = overwrite.Permissions.DenyValue.ToString() | ||||
}).ToArray() | }).ToArray() | ||||
: Optional.Create<API.Overwrite[]>(), | : Optional.Create<API.Overwrite[]>(), | ||||
VideoQuality = props.VideoQualityMode, | |||||
RtcRegion = props.RTCRegion | |||||
}; | }; | ||||
var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false); | var model = await client.ApiClient.CreateGuildChannelAsync(guild.Id, args, options).ConfigureAwait(false); | ||||
return RestVoiceChannel.Create(client, guild, model); | return RestVoiceChannel.Create(client, guild, model); | ||||
@@ -34,6 +34,8 @@ namespace Discord.WebSocket | |||||
public int? UserLimit { get; private set; } | public int? UserLimit { get; private set; } | ||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public string RTCRegion { get; private set; } | public string RTCRegion { get; private set; } | ||||
/// <inheritdoc/> | |||||
public VideoQualityMode VideoQualityMode { get; private set; } | |||||
/// <summary> | /// <summary> | ||||
/// Gets a collection of users that are currently connected to this voice channel. | /// Gets a collection of users that are currently connected to this voice channel. | ||||
@@ -60,6 +62,7 @@ namespace Discord.WebSocket | |||||
base.Update(state, model); | base.Update(state, model); | ||||
Bitrate = model.Bitrate.GetValueOrDefault(64000); | Bitrate = model.Bitrate.GetValueOrDefault(64000); | ||||
UserLimit = model.UserLimit.GetValueOrDefault() != 0 ? model.UserLimit.Value : (int?)null; | UserLimit = model.UserLimit.GetValueOrDefault() != 0 ? model.UserLimit.Value : (int?)null; | ||||
VideoQualityMode = model.VideoQualityMode.GetValueOrDefault(VideoQualityMode.Auto); | |||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null); | RTCRegion = model.RTCRegion.GetValueOrDefault(null); | ||||
} | } | ||||
@@ -38,6 +38,8 @@ namespace Discord | |||||
public ChannelFlags Flags => throw new NotImplementedException(); | public ChannelFlags Flags => throw new NotImplementedException(); | ||||
public VideoQualityMode VideoQualityMode => throw new NotImplementedException(); | |||||
public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | public Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | ||||
public Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | public Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) => throw new NotImplementedException(); | ||||
public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) => throw new NotImplementedException(); | public Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false) => throw new NotImplementedException(); | ||||