From 41395ce34cc916ad178e553587081282eaad3d94 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Wed, 13 Jun 2018 17:55:57 +0100 Subject: [PATCH 1/5] Small amount to see if I'm doing it right --- .../Entities/Channels/SocketGuildChannel.cs | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index 075b2866c..e48c6dd5f 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -78,6 +78,15 @@ namespace Discord.WebSocket 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 + /// + /// + /// Null if the user has no overwrite permissions otherwise the overwrite permissions for the user + /// public OverwritePermissions? GetPermissionOverwrite(IUser user) { for (int i = 0; i < _overwrites.Length; i++) @@ -87,6 +96,16 @@ namespace Discord.WebSocket } return null; } + + /// + /// Gets the overwrite permissions of the specified + /// + /// + /// The role that you want to get the overwrite permissions for + /// + /// + /// Null if the role has no overwrite permissions otherwise the overwrite permissions for the role + /// public OverwritePermissions? GetPermissionOverwrite(IRole role) { for (int i = 0; i < _overwrites.Length; i++) @@ -96,11 +115,37 @@ namespace Discord.WebSocket } 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 + /// 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 + /// public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false); From 904fd2f20022f96bed2fd646b9ea7a1441ec2ab6 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Sun, 17 Jun 2018 12:09:52 +0100 Subject: [PATCH 2/5] Changes to last pr --- .../Entities/Channels/SocketGuildChannel.cs | 44 ++++++------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index e48c6dd5f..79d95fd82 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -79,13 +79,11 @@ namespace Discord.WebSocket => ChannelHelper.DeleteAsync(this, Discord, options); /// - /// Gets the overwrite permissions of the specified + /// Gets the overwrite permissions of the specified . /// - /// - /// The user that you want to get the overwrite permissions for - /// + /// The user that you want to get the overwrite permissions for. /// - /// Null if the user has no overwrite permissions otherwise the overwrite permissions for the user + /// The overwrite permissions for the requested user; otherwise null. /// public OverwritePermissions? GetPermissionOverwrite(IUser user) { @@ -98,13 +96,11 @@ namespace Discord.WebSocket } /// - /// Gets the overwrite permissions of the specified + /// Gets the overwrite permissions of the specified . /// - /// - /// The role that you want to get the overwrite permissions for - /// + /// The role that you want to get the overwrite permissions for. /// - /// Null if the role has no overwrite permissions otherwise the overwrite permissions for the role + /// The overwrite permissions for the requested role; otherwise null. /// public OverwritePermissions? GetPermissionOverwrite(IRole role) { @@ -117,17 +113,11 @@ namespace Discord.WebSocket } /// - /// Adds an overwrite permission for the specified + /// 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 - /// + /// 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. public async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, user, perms, options).ConfigureAwait(false); @@ -135,17 +125,11 @@ namespace Discord.WebSocket } /// - /// Adds an overwrite permission for the specified + /// 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 - /// + /// 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. public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false); From 034d473209fcf785ed27e39b9a905884e3165e67 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Sun, 17 Jun 2018 12:39:13 +0100 Subject: [PATCH 3/5] no hablo ingles --- .../Entities/Channels/SocketGuildChannel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index 79d95fd82..02037bc3c 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -100,7 +100,7 @@ namespace Discord.WebSocket /// /// The role that you want to get the overwrite permissions for. /// - /// The overwrite permissions for the requested role; otherwise null. + /// The overwrite permissions for the requested role; otherwise null. /// public OverwritePermissions? GetPermissionOverwrite(IRole role) { From 4f24ea6d1b92bc776b1eb2fa75788538ced15b5b Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Sun, 17 Jun 2018 12:44:56 +0100 Subject: [PATCH 4/5] Try try try again --- .../Entities/Channels/SocketGuildChannel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index 02037bc3c..61fb7c3b2 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -118,6 +118,7 @@ namespace Discord.WebSocket /// 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); @@ -130,6 +131,7 @@ namespace Discord.WebSocket /// 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); From af8a77dbc5073474bccf7f5f8ed949c851986e09 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Sun, 17 Jun 2018 12:49:21 +0100 Subject: [PATCH 5/5] I'm sure you're having as much fun as I am --- .../Entities/Channels/SocketGuildChannel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index 61fb7c3b2..43cc26f6d 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -118,7 +118,9 @@ namespace Discord.WebSocket /// 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 . + /// + /// An awaitable . + /// public async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, user, perms, options).ConfigureAwait(false); @@ -131,7 +133,9 @@ namespace Discord.WebSocket /// 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 . + /// + /// An awaitable . + /// public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions perms, RequestOptions options = null) { await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false);