Class SocketGuildChannel
Represent a WebSocket-based guild channel.
Inherited Members
Namespace: Kook.WebSocket
Assembly: Kook.Net.WebSocket.dll
Syntax
public class SocketGuildChannel : SocketChannel, IEntity<ulong>, IUpdateable, IGuildChannel, IChannel, IEntity<ulong>, IDeletable
Properties
Creator
Gets the creator of this channel.
Declaration
public SocketGuildUser Creator { get; }
Property Value
SocketGuildUser
A task that represents the asynchronous get operation. The task result contains the creator of this channel. |
Remarks
This method will try to get the user as a member of this channel. If the user is not a member of this guild,
this method will return null
. To get the creator under this circumstance, use
GetUserAsync(UInt64, RequestOptions).
CreatorId
Guild
Gets the guild associated with this channel.
Declaration
public SocketGuild Guild { get; }
Property Value
SocketGuild
A guild object that this channel belongs to. |
Name
Position
RolePermissionOverwrites
Declaration
public IReadOnlyCollection<RolePermissionOverwrite> RolePermissionOverwrites { get; }
Property Value
IReadOnlyCollection<RolePermissionOverwrite>
|
Type
Gets the type of this channel.
Declaration
public ChannelType Type { get; }
Property Value
ChannelType
A ChannelType representing the type of this channel. |
Implements
UserPermissionOverwrites
Declaration
public IReadOnlyCollection<UserPermissionOverwrite> UserPermissionOverwrites { get; }
Property Value
IReadOnlyCollection<UserPermissionOverwrite>
|
Users
Gets a collection of users that are able to view the channel.
Declaration
public virtual IReadOnlyCollection<SocketGuildUser> Users { get; }
Property Value
IReadOnlyCollection<SocketGuildUser>
A read-only collection of users that can access the channel (i.e. the users seen in the user list). |
Methods
AddPermissionOverwriteAsync(IGuildUser, RequestOptions)
Adds or updates the permission overwrite for the given user.
Declaration
public Task AddPermissionOverwriteAsync(IGuildUser user, RequestOptions options = null)
Parameters
IGuildUser
user
The user to add the overwrite to. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
AddPermissionOverwriteAsync(IRole, RequestOptions)
Adds or updates the permission overwrite for the given role.
Declaration
public Task AddPermissionOverwriteAsync(IRole role, RequestOptions options = null)
Parameters
IRole
role
The role to add the overwrite to. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
DeleteAsync(RequestOptions)
Declaration
public Task DeleteAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
GetPermissionOverwrite(IRole)
Gets the permission overwrite for a specific role.
Declaration
public virtual OverwritePermissions? GetPermissionOverwrite(IRole role)
Parameters
IRole
role
The role to get the overwrite from. |
Returns
Nullable<OverwritePermissions>
An overwrite object for the targeted role; |
GetPermissionOverwrite(IUser)
Gets the permission overwrite for a specific user.
Declaration
public virtual OverwritePermissions? GetPermissionOverwrite(IUser user)
Parameters
IUser
user
The user to get the overwrite from. |
Returns
Nullable<OverwritePermissions>
An overwrite object for the targeted user; |
GetUser(UInt64)
Gets a SocketGuildUser from this channel.
Declaration
public virtual SocketGuildUser GetUser(ulong id)
Parameters
UInt64
id
The user's identifier. |
Returns
SocketGuildUser
A SocketGuildUser with the provided identifier; |
ModifyAsync(Action<ModifyGuildChannelProperties>, RequestOptions)
Declaration
public Task ModifyAsync(Action<ModifyGuildChannelProperties> func, RequestOptions options = null)
Parameters
Action<ModifyGuildChannelProperties>
func
|
RequestOptions
options
|
Returns
Task
|
ModifyPermissionOverwriteAsync(IGuildUser, Func<OverwritePermissions, OverwritePermissions>, RequestOptions)
Updates the permission overwrite for the given user, if one exists.
Declaration
public Task ModifyPermissionOverwriteAsync(IGuildUser user, Func<OverwritePermissions, OverwritePermissions> func, RequestOptions options = null)
Parameters
IGuildUser
user
The user to modify the overwrite for. |
Func<OverwritePermissions, OverwritePermissions>
func
A delegate containing the values to modify the permission overwrite with. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous operation for removing the specified permissions from the channel. |
ModifyPermissionOverwriteAsync(IRole, Func<OverwritePermissions, OverwritePermissions>, RequestOptions)
Updates the permission overwrite for the given role, if one exists.
Declaration
public Task ModifyPermissionOverwriteAsync(IRole role, Func<OverwritePermissions, OverwritePermissions> func, RequestOptions options = null)
Parameters
IRole
role
The role to remove the overwrite for. |
Func<OverwritePermissions, OverwritePermissions>
func
A delegate containing the values to modify the permission overwrite with. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous operation for removing the specified permissions from the channel. |
RemovePermissionOverwriteAsync(IGuildUser, RequestOptions)
Removes the permission overwrite for the given user, if one exists.
Declaration
public Task RemovePermissionOverwriteAsync(IGuildUser user, RequestOptions options = null)
Parameters
IGuildUser
user
The user to remove the overwrite from. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous operation for removing the specified permissions from the channel. |
RemovePermissionOverwriteAsync(IRole, RequestOptions)
Removes the permission overwrite for the given role, if one exists.
Declaration
public Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
Parameters
IRole
role
The role to remove the overwrite from. |
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task representing the asynchronous operation for removing the specified permissions from the channel. |
ToString()
Gets the name of the channel.
Declaration
public override string ToString()
Returns
String
A string that resolves to Name. |
UpdateAsync(RequestOptions)
Declaration
public override Task UpdateAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
Overrides
Explicit Interface Implementations
IGuildChannel.Guild
Gets the guild associated with this channel.
Declaration
IGuild IGuildChannel.Guild { get; }
Returns
IGuild
A guild object that this channel belongs to. |