diff --git a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs index 1da1879de..dab7f436d 100644 --- a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs @@ -47,6 +47,10 @@ namespace Discord /// /// Modifies this guild channel. /// + /// + /// This method modifies the current guild channel with the specified properties. To see an example of this + /// method and what properties are available, please refer to . + /// /// The delegate containing the properties to modify the channel with. /// The options to be used when sending the request. /// @@ -92,16 +96,61 @@ namespace Discord /// /// Adds or updates the permission overwrite for the given role. /// + /// + /// The following example fetches a role via and a channel via + /// . Next, it checks if an overwrite had already been set via + /// ; if not, it denies the role from sending any + /// messages to the channel. + /// + /// // Fetches the role and channels + /// var role = guild.GetRole(339805618376540160); + /// var channel = await guild.GetChannelAsync(233937283911385098); + /// + /// // If either the of the object does not exist, bail + /// if (role == null || channel == null) return; + /// + /// // Fetches the previous overwrite and bail if one is found + /// var previousOverwrite = channel.GetPermissionOverwrite(role); + /// if (previousOverwrite.HasValue) return; + /// + /// // Creates a new OverwritePermissions with send message set to deny and pass it into the method + /// await channel.AddPermissionOverwriteAsync(role, + /// new OverwritePermissions(sendMessage: PermValue.Deny)); + /// + /// /// The role to add the overwrite to. /// The overwrite to add to the role. /// The options to be used when sending the request. /// - /// A task representing the asynchronous permission operation for adding the specified permissions to the channel. + /// A task representing the asynchronous permission operation for adding the specified permissions to the + /// channel. /// Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null); /// /// Adds or updates the permission overwrite for the given user. /// + /// + /// The following example fetches a user via and a channel via + /// . Next, it checks if an overwrite had already been set via + /// ; if not, it denies the user from sending any + /// messages to the channel. + /// + /// // Fetches the role and channels + /// var user = await guild.GetUserAsync(168693960628371456); + /// var channel = await guild.GetChannelAsync(233937283911385098); + /// + /// // If either the of the object does not exist, bail + /// if (user == null || channel == null) return; + /// + /// // Fetches the previous overwrite and bail if one is found + /// var previousOverwrite = channel.GetPermissionOverwrite(user); + /// if (previousOverwrite.HasValue) return; + /// + /// // Creates a new OverwritePermissions with send message set to deny and pass it into the method + /// await channel.AddPermissionOverwriteAsync(role, + /// new OverwritePermissions(sendMessage: PermValue.Deny)); + /// + /// /// The user to add the overwrite to. /// The overwrite to add to the user. /// The options to be used when sending the request.