Browse Source

Add overwrites to voice and change CategoryId docs

pull/1608/head
Paulo 5 years ago
parent
commit
2258c15f97
2 changed files with 11 additions and 2 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs
  2. +10
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Channels/GuildChannelProperties.cs View File

@@ -28,7 +28,7 @@ namespace Discord
/// </summary>
/// <remarks>
/// Setting this value to a category's snowflake identifier will change or set this channel's parent to the
/// specified channel; setting this value to <c>0</c> will detach this channel from its parent if one
/// specified channel; setting this value to <see langword="null"/> will detach this channel from its parent if one
/// is set.
/// </remarks>
public Optional<ulong?> CategoryId { get; set; }


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

@@ -70,7 +70,16 @@ namespace Discord.Rest
Name = args.Name,
Position = args.Position,
CategoryId = args.CategoryId,
UserLimit = args.UserLimit.IsSpecified ? (args.UserLimit.Value ?? 0) : Optional.Create<int>()
UserLimit = args.UserLimit.IsSpecified ? (args.UserLimit.Value ?? 0) : Optional.Create<int>(),
Overwrites = args.PermissionOverwrites.IsSpecified
? args.PermissionOverwrites.Value.Select(overwrite => new API.Overwrite
{
TargetId = overwrite.TargetId,
TargetType = overwrite.TargetType,
Allow = overwrite.Permissions.AllowValue,
Deny = overwrite.Permissions.DenyValue
}).ToArray()
: Optional.Create<API.Overwrite[]>(),
};
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
}


Loading…
Cancel
Save