Browse Source

Add voice region to modify voice channels

pull/1923/head
quin lynch 3 years ago
parent
commit
cee64e0026
3 changed files with 7 additions and 0 deletions
  1. +4
    -0
      src/Discord.Net.Core/Entities/Channels/VoiceChannelProperties.cs
  2. +2
    -0
      src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
  3. +1
    -0
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 4
- 0
src/Discord.Net.Core/Entities/Channels/VoiceChannelProperties.cs View File

@@ -13,5 +13,9 @@ namespace Discord
/// Gets or sets the maximum number of users that can be present in a channel, or <c>null</c> if none.
/// </summary>
public Optional<int?> UserLimit { get; set; }
/// <summary>
/// Gets or sets the channel voice region id, automatic when set to <see langword="null"/>.
/// </summary>
public Optional<string> RTCRegion { get; set; }
}
}

+ 2
- 0
src/Discord.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs View File

@@ -9,5 +9,7 @@ namespace Discord.API.Rest
public Optional<int> Bitrate { get; set; }
[JsonProperty("user_limit")]
public Optional<int> UserLimit { get; set; }
[JsonProperty("rtc_region")]
public Optional<string> RTCRegion { get; set; }
}
}

+ 1
- 0
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

@@ -77,6 +77,7 @@ namespace Discord.Rest
{
Bitrate = args.Bitrate,
Name = args.Name,
RTCRegion = args.RTCRegion,
Position = args.Position,
CategoryId = args.CategoryId,
UserLimit = args.UserLimit.IsSpecified ? (args.UserLimit.Value ?? 0) : Optional.Create<int>(),


Loading…
Cancel
Save