|
|
@@ -30,7 +30,7 @@ namespace Discord.WebSocket |
|
|
|
public int Position { get; private set; } |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites; |
|
|
|
public virtual IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites; |
|
|
|
/// <summary> |
|
|
|
/// Gets a collection of users that are able to view the channel. |
|
|
|
/// </summary> |
|
|
@@ -87,7 +87,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// An overwrite object for the targeted user; <c>null</c> if none is set. |
|
|
|
/// </returns> |
|
|
|
public OverwritePermissions? GetPermissionOverwrite(IUser user) |
|
|
|
public virtual OverwritePermissions? GetPermissionOverwrite(IUser user) |
|
|
|
{ |
|
|
|
for (int i = 0; i < _overwrites.Length; i++) |
|
|
|
{ |
|
|
@@ -103,7 +103,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// An overwrite object for the targeted role; <c>null</c> if none is set. |
|
|
|
/// </returns> |
|
|
|
public OverwritePermissions? GetPermissionOverwrite(IRole role) |
|
|
|
public virtual OverwritePermissions? GetPermissionOverwrite(IRole role) |
|
|
|
{ |
|
|
|
for (int i = 0; i < _overwrites.Length; i++) |
|
|
|
{ |
|
|
@@ -122,7 +122,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
|
|
|
/// </returns> |
|
|
|
public async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) |
|
|
|
public virtual async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null) |
|
|
|
{ |
|
|
|
await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, user, permissions, options).ConfigureAwait(false); |
|
|
|
_overwrites = _overwrites.Add(new Overwrite(user.Id, PermissionTarget.User, new OverwritePermissions(permissions.AllowValue, permissions.DenyValue))); |
|
|
@@ -137,7 +137,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
|
|
|
/// </returns> |
|
|
|
public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) |
|
|
|
public virtual async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null) |
|
|
|
{ |
|
|
|
await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, permissions, options).ConfigureAwait(false); |
|
|
|
_overwrites = _overwrites.Add(new Overwrite(role.Id, PermissionTarget.Role, new OverwritePermissions(permissions.AllowValue, permissions.DenyValue))); |
|
|
@@ -150,7 +150,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// A task representing the asynchronous operation for removing the specified permissions from the channel. |
|
|
|
/// </returns> |
|
|
|
public async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null) |
|
|
|
public virtual async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null) |
|
|
|
{ |
|
|
|
await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, user, options).ConfigureAwait(false); |
|
|
|
|
|
|
@@ -171,7 +171,7 @@ namespace Discord.WebSocket |
|
|
|
/// <returns> |
|
|
|
/// A task representing the asynchronous operation for removing the specified permissions from the channel. |
|
|
|
/// </returns> |
|
|
|
public async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null) |
|
|
|
public virtual async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null) |
|
|
|
{ |
|
|
|
await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, role, options).ConfigureAwait(false); |
|
|
|
|
|
|
|