Class RestGuildChannel
Represents a private REST-based group channel.
Assembly: Discord.Net.Rest.dll​
View Source​
public class RestGuildChannel : RestChannel, IUpdateable, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties​
PermissionOverwrites​
Gets a collection of permission overwrites for this channel.
View Source​
public virtual IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }
Name​
Gets the name of this channel.
View Source​
public string Name { get; }
Position​
Gets the position of this channel.
View Source​
public int Position { get; }
GuildId​
Gets the guild ID associated with this channel.
View Source​
public ulong GuildId { get; }
IGuildChannel.Guild​
Gets the guild associated with this channel.
View Source​
IGuild IGuildChannel.Guild { get; }
Methods​
UpdateAsync(RequestOptions)​
Updates this object's properties with its current state.
View Source​
public override async Task UpdateAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync(Action<GuildChannelProperties>, RequestOptions)​
Modifies this guild channel.
View Source​
public async Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.GuildChannelProperties> | func | The delegate containing the properties to modify the channel with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteAsync(RequestOptions)​
Deletes this object and all its children.
View Source​
public Task DeleteAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetPermissionOverwrite(IUser)​
Gets the permission overwrite for a specific user.
View Source​
public virtual OverwritePermissions? GetPermissionOverwrite(IUser user)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted user; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to get the overwrite from. |
GetPermissionOverwrite(IRole)​
Gets the permission overwrite for a specific role.
View Source​
public virtual OverwritePermissions? GetPermissionOverwrite(IRole role)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted role; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to get the overwrite from. |
AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given user.
View Source​
public virtual async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given role.
View Source​
public virtual async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the role. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemovePermissionOverwriteAsync(IUser, RequestOptions)​
Removes the permission overwrite for the given user, if one exists.
View Source​
public virtual async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemovePermissionOverwriteAsync(IRole, RequestOptions)​
Removes the permission overwrite for the given role, if one exists.
View Source​
public virtual async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ToString()​
Gets the name of this channel.
View Source​
public override string ToString()
Returns​
System.String
:
A string that is the name of this channel.
IGuildChannel.GetPermissionOverwrite(IRole)​
Gets the permission overwrite for a specific role.
View Source​
OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IRole role)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted role; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to get the overwrite from. |
IGuildChannel.GetPermissionOverwrite(IUser)​
Gets the permission overwrite for a specific user.
View Source​
OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IUser user)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted user; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to get the overwrite from. |
IGuildChannel.AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given role.
View Source​
async Task IGuildChannel.AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the
channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the role. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuildChannel.AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given user.
View Source​
async Task IGuildChannel.AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuildChannel.RemovePermissionOverwriteAsync(IRole, RequestOptions)​
Removes the permission overwrite for the given role, if one exists.
View Source​
async Task IGuildChannel.RemovePermissionOverwriteAsync(IRole role, RequestOptions options)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuildChannel.RemovePermissionOverwriteAsync(IUser, RequestOptions)​
Removes the permission overwrite for the given user, if one exists.
View Source​
async Task IGuildChannel.RemovePermissionOverwriteAsync(IUser user, RequestOptions options)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuildChannel.GetUsersAsync(CacheMode, RequestOptions)​
Gets a collection of users that are able to view the channel or are currently in this channel.
View Source​
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>
:
Paged collection of users.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user in this channel.
View Source​
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
:
A task representing the asynchronous get operation. The task result contains a guild user object that
represents the user; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IChannel.GetUsersAsync(CacheMode, RequestOptions)​
Gets a collection of users that are able to view the channel or are currently in this channel.
View Source​
IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>
:
Paged collection of users.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user in this channel.
View Source​
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IUser>
:
A task that represents the asynchronous get operation. The task result contains a user object that
represents the found user; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user (e.g. 168693960628371456 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |