From 908f29b5486c3d3a9b835053de38a44c9d2e1cc1 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Thu, 12 Jul 2018 02:06:45 +0100 Subject: [PATCH] Added RestGuildChannel documentation --- .../Entities/Channels/RestGuildChannel.cs | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs index cc52a9864..5895500bd 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs @@ -72,6 +72,13 @@ namespace Discord.Rest public Task DeleteAsync(RequestOptions options = null) => ChannelHelper.DeleteAsync(this, Discord, options); + /// + /// Gets the overwrite permissions of the specified . + /// + /// The user that you want to get the overwrite permissions for. + /// + /// The overwrite permissions for the requested user; otherwise null. + /// public OverwritePermissions? GetPermissionOverwrite(IUser user) { for (int i = 0; i < _overwrites.Length; i++) @@ -81,6 +88,14 @@ namespace Discord.Rest } return null; } + + /// + /// Gets the overwrite permissions of the specified . + /// + /// The role that you want to get the overwrite permissions for. + /// + /// The overwrite permissions for the requested role; otherwise null. + /// public OverwritePermissions? GetPermissionOverwrite(IRole role) { for (int i = 0; i < _overwrites.Length; i++) @@ -90,16 +105,45 @@ namespace Discord.Rest } return null; } + + /// + /// Adds an overwrite permission for the specified . + /// + /// The user you want the overwrite permission to apply to. + /// The overwrite permission you want to add. + /// The options to be used when sending the request. + /// + /// An awaitable . + /// public async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, user, perms, options).ConfigureAwait(false); _overwrites = _overwrites.Add(new Overwrite(user.Id, PermissionTarget.User, new OverwritePermissions(perms.AllowValue, perms.DenyValue))); } + + /// + /// Adds an overwrite permission for the specified . + /// + /// The role you want the overwrite permission to apply to. + /// The overwrite permission you want to add. + /// The options to be used when sending the request. + /// + /// An awaitable . + /// public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false); _overwrites = _overwrites.Add(new Overwrite(role.Id, PermissionTarget.Role, new OverwritePermissions(perms.AllowValue, perms.DenyValue))); } + + /// + /// Removes an overwrite permission for the specified . + /// + /// The user you want to remove the overwrite permission from. + /// The options to be used when sending the request. + /// + /// An awaitable . + /// public async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null) { await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, user, options).ConfigureAwait(false); @@ -113,6 +157,15 @@ namespace Discord.Rest } } } + + /// + /// Removes an overwrite permission for the specified . + /// + /// The role you want the overwrite permissions to be removed from. + /// The options to be used when sending the request. + /// + /// An awaitable . + /// public async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null) { await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, role, options).ConfigureAwait(false); @@ -127,11 +180,38 @@ namespace Discord.Rest } } + /// + /// Gets the invites for this channel. + /// + /// The options to be used when sending the request. + /// + /// An awaitable containing an . + /// contains information such as, the number of times the invite has + /// been used, who created the invite, and when the invite was created. + /// public async Task> GetInvitesAsync(RequestOptions options = null) => await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false); + + /// + /// Creates an invite for this channel. + /// + /// The number of seconds that you want the invite to be valid for. + /// The number of times this invite can be used before it expires. + /// Whether or not the invite grants temporary membership. + /// Whether to try reuse a similar invite or not. + /// The options to be used when sending the request. + /// + /// An awaitable containing a . + /// public async Task CreateInviteAsync(int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null) => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false); + /// + /// Gets the name of this channel. + /// + /// + /// A string that is the name of this channel. + /// public override string ToString() => Name; //IGuildChannel