Table of Contents

Interface IGuildUser

Namespace
Kook
Assembly
Kook.Net.Core.dll

Represents a generic guild user.

public interface IGuildUser : IUser, IEntity<ulong>, IMentionable, IPresence, IVoiceState
Inherited Members
Extension Methods

Properties

ActiveAt

Gets when this user was activated.

DateTimeOffset? ActiveAt { get; }

Property Value

DateTimeOffset?

The time of which the user was activated.

Color

Gets the color the user's displayed name is being displayed in.

Color? Color { get; }

Property Value

Color?

A Color struct representing the color the user's display name is being displayed in.

Remarks

warning

At present, the color of a role may be a solid color or a gradient. See ColorType, which is guaranteed due to the fact that the guild's user list API endpoint returns the color type and the gradient color information if exists. However, the value of this property is fetched from the guild's user list API endpoint, which does not return the color type and the gradient color information. Hence, the value of this property may be incorrect if the color of a role is a gradient.

DisplayName

Gets the displayed name for this user.

string DisplayName { get; }

Property Value

string

A string representing the display name of the user; If the nickname is null, this will be the username.

Guild

Gets the guild for this user.

IGuild Guild { get; }

Property Value

IGuild

A guild object that this user belongs to.

GuildId

Gets the ID of the guild for this user.

ulong GuildId { get; }

Property Value

ulong

An ulong representing the identifier of the guild that this user belongs to.

GuildPermissions

Gets the guild-level permissions for this user.

GuildPermissions GuildPermissions { get; }

Property Value

GuildPermissions

A GuildPermissions structure for this user, representing what permissions this user has in the guild.

IsMobileVerified

Gets whether the mobile number has been verified for this user.

bool? IsMobileVerified { get; }

Property Value

bool?

true if the mobile number has been verified; false otherwise.

IsOwner

Gets whether this user owns the current guild.

bool? IsOwner { get; }

Property Value

bool?

true if this user owns the current guild; false otherwise.

JoinedAt

Gets when this user joined the guild.

DateTimeOffset? JoinedAt { get; }

Property Value

DateTimeOffset?

The time of which the user has joined the guild.

Nickname

Gets the nickname for this user.

string? Nickname { get; }

Property Value

string

A string representing the nickname of the user; null if none is set.

RoleIds

Gets a collection of IDs for the roles that this user currently possesses in the guild.

IReadOnlyCollection<uint> RoleIds { get; }

Property Value

IReadOnlyCollection<uint>

A read-only collection of uint, each representing an identifier for a role that this user possesses.

Remarks

This property returns a read-only collection of the identifiers of the roles that this user possesses. For WebSocket users, a Roles property can be found in place of this property. Due to the REST implementation, only a collection of identifiers can be retrieved instead of the full role objects.

Methods

AddRoleAsync(IRole, RequestOptions?)

Adds the specified role to this user in the guild.

Task AddRoleAsync(IRole role, RequestOptions? options = null)

Parameters

role IRole

The role to be added to the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role addition operation.

AddRoleAsync(uint, RequestOptions?)

Adds the specified role to this user in the guild.

Task AddRoleAsync(uint roleId, RequestOptions? options = null)

Parameters

roleId uint

The role to be added to the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role addition operation.

AddRolesAsync(IEnumerable<IRole>, RequestOptions?)

Adds the specified roles to this user in the guild.

Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions? options = null)

Parameters

roles IEnumerable<IRole>

The roles to be added to the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role addition operation.

AddRolesAsync(IEnumerable<uint>, RequestOptions?)

Adds the specified roleIds to this user in the guild.

Task AddRolesAsync(IEnumerable<uint> roleIds, RequestOptions? options = null)

Parameters

roleIds IEnumerable<uint>

The roles to be added to the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role addition operation.

DeafenAsync(RequestOptions?)

Deafen this user in this guild.

Task DeafenAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous deafening operation.

GetBoostSubscriptionsAsync(RequestOptions?)

Gets all subscriptions of this user for this guild.

Task<IReadOnlyCollection<BoostSubscriptionMetadata>> GetBoostSubscriptionsAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<BoostSubscriptionMetadata>>

A task that represents the asynchronous retrieval operation. The task result contains a collection of BoostSubscriptionMetadata, each representing the subscription information.

GetConnectedVoiceChannelsAsync(RequestOptions?)

Gets a collection of voice channels a user.

Task<IReadOnlyCollection<IVoiceChannel>> GetConnectedVoiceChannelsAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IVoiceChannel>>

A task that represents the asynchronous get operation. The task result contains a collection of voice channels the user is connected to.

GetPermissions(IGuildChannel)

Gets the level permissions granted to this user to a given channel.

ChannelPermissions GetPermissions(IGuildChannel channel)

Parameters

channel IGuildChannel

The channel to get the permission from.

Returns

ChannelPermissions

A ChannelPermissions structure representing the permissions that a user has in the specified channel.

KickAsync(RequestOptions?)

Kicks this user from this guild.

Task KickAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous kick operation.

ModifyNicknameAsync(string?, RequestOptions?)

Modifies this user's nickname in this guild.

Task ModifyNicknameAsync(string? name, RequestOptions? options = null)

Parameters

name string

The nickname to modify the user 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 nickname of current guild user.

warning

The KOOK API will clear the nickname if the nickname is set to the same as the username at present. Hence either setting the nickname to the same as the username or setting the nickname to null will clear the nickname.

MuteAsync(RequestOptions?)

Mute this user in this guild.

Task MuteAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous muting operation.

RemoveRoleAsync(IRole, RequestOptions?)

Removes the specified role from this user in the guild.

Task RemoveRoleAsync(IRole role, RequestOptions? options = null)

Parameters

role IRole

The role to be removed from the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role removal operation.

RemoveRoleAsync(uint, RequestOptions?)

Removes the specified roleId from this user in the guild.

Task RemoveRoleAsync(uint roleId, RequestOptions? options = null)

Parameters

roleId uint

The role to be removed from the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role removal operation.

RemoveRolesAsync(IEnumerable<IRole>, RequestOptions?)

Removes the specified roles from this user in the guild.

Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions? options = null)

Parameters

roles IEnumerable<IRole>

The roles to be removed from the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role removal operation.

RemoveRolesAsync(IEnumerable<uint>, RequestOptions?)

Removes the specified roleIds from this user in the guild.

Task RemoveRolesAsync(IEnumerable<uint> roleIds, RequestOptions? options = null)

Parameters

roleIds IEnumerable<uint>

The roles to be removed from the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous role removal operation.

UndeafenAsync(RequestOptions?)

Undeafen this user in this guild.

Task UndeafenAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous undeafening operation.

UnmuteAsync(RequestOptions?)

Unmute this user in this guild.

Task UnmuteAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous unmuting operation.