Table of Contents

Interface IGuildChannel

Namespace
Kook
Assembly
Kook.Net.Core.dll

Represents a generic guild channel.

public interface IGuildChannel : IChannel, IEntity<ulong>, IDeletable
Inherited Members
Extension Methods

Properties

CreatorId

Gets the identifier of the user who created this channel.

ulong CreatorId { get; }

Property Value

ulong

A ulong representing the identifier of the user who created this channel.

Guild

Gets the guild associated with this channel.

IGuild Guild { get; }

Property Value

IGuild

A guild object that this channel belongs to.

GuildId

Gets the guild ID associated with this channel.

ulong GuildId { get; }

Property Value

ulong

An ulong representing the guild identifier for the guild that this channel belongs to.

Position

Gets the position of this channel.

int? Position { get; }

Property Value

int?

An int representing the position of this channel in the guild's channel list relative to others of the same type.

RolePermissionOverwrites

Gets a collection of permission overwrites for roles for this channel.

IReadOnlyCollection<RolePermissionOverwrite> RolePermissionOverwrites { get; }

Property Value

IReadOnlyCollection<RolePermissionOverwrite>

A collection of overwrites for roles associated with this channel.

Type

Gets the type of this channel.

ChannelType Type { get; }

Property Value

ChannelType

A ChannelType representing the type of this channel.

UserPermissionOverwrites

Gets a collection of permission overwrites for users for this channel.

IReadOnlyCollection<UserPermissionOverwrite> UserPermissionOverwrites { get; }

Property Value

IReadOnlyCollection<UserPermissionOverwrite>

A collection of overwrites for users associated with this channel.

Methods

AddPermissionOverwriteAsync(IGuildUser, RequestOptions)

Adds the permission overwrite for the given user.

Task AddPermissionOverwriteAsync(IGuildUser user, RequestOptions options = null)

Parameters

user IGuildUser

The user to add the overwrite to.

options RequestOptions

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 the permission overwrite for the given role.

Task AddPermissionOverwriteAsync(IRole role, RequestOptions options = null)

Parameters

role IRole

The role to add the overwrite to.

options RequestOptions

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.

GetCreatorAsync(CacheMode, RequestOptions)

Gets the creator of this channel.

Task<IUser> GetCreatorAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IUser>

A task that represents the asynchronous get operation. The task result contains the creator of this channel.

GetPermissionOverwrite(IRole)

Gets the permission overwrite for a specific role.

OverwritePermissions? GetPermissionOverwrite(IRole role)

Parameters

role IRole

The role to get the overwrite from.

Returns

OverwritePermissions?

An overwrite object for the targeted role; null if none is set.

GetPermissionOverwrite(IUser)

Gets the permission overwrite for a specific user.

OverwritePermissions? GetPermissionOverwrite(IUser user)

Parameters

user IUser

The user to get the overwrite from.

Returns

OverwritePermissions?

An overwrite object for the targeted user; null if none is set.

GetUserAsync(ulong, CacheMode, RequestOptions)

Gets a user in this channel.

Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The identifier of the user.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<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.

GetUsersAsync(CacheMode, RequestOptions)

Gets a collection of users that are able to view the channel or are currently in this channel.

IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IGuildUser>>

Paged collection of users.

Remarks

This method follows the same behavior as described in GetUsersAsync(CacheMode, RequestOptions). Please visit its documentation for more details on this method.

ModifyAsync(Action<ModifyGuildChannelProperties>, RequestOptions)

Modifies this guild channel.

Task ModifyAsync(Action<ModifyGuildChannelProperties> func, RequestOptions options = null)

Parameters

func Action<ModifyGuildChannelProperties>

The delegate containing the properties to modify the channel with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

Remarks

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 ModifyGuildChannelProperties.

ModifyPermissionOverwriteAsync(IGuildUser, Func<OverwritePermissions, OverwritePermissions>, RequestOptions)

Updates the permission overwrite for the given user.

Task ModifyPermissionOverwriteAsync(IGuildUser user, Func<OverwritePermissions, OverwritePermissions> func, RequestOptions options = null)

Parameters

user IGuildUser

The user to add the overwrite to.

func Func<OverwritePermissions, OverwritePermissions>

A delegate containing the values to modify the permission overwrite with.

options RequestOptions

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.

ModifyPermissionOverwriteAsync(IRole, Func<OverwritePermissions, OverwritePermissions>, RequestOptions)

Updates the permission overwrite for the given role.

Task ModifyPermissionOverwriteAsync(IRole role, Func<OverwritePermissions, OverwritePermissions> func, RequestOptions options = null)

Parameters

role IRole

The role to add the overwrite to.

func Func<OverwritePermissions, OverwritePermissions>

A delegate containing the values to modify the permission overwrite with.

options RequestOptions

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.

RemovePermissionOverwriteAsync(IGuildUser, RequestOptions)

Removes the permission overwrite for the given user, if one exists.

Task RemovePermissionOverwriteAsync(IGuildUser user, RequestOptions options = null)

Parameters

user IGuildUser

The user to remove the overwrite from.

options RequestOptions

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.

Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)

Parameters

role IRole

The role to remove the overwrite from.

options RequestOptions

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.