Table of Contents

Class SocketUser

Namespace
Kook.WebSocket
Assembly
Kook.Net.WebSocket.dll

Represents a WebSocket-based user.

public abstract class SocketUser : SocketEntity<ulong>, IUser, IEntity<ulong>, IMentionable, IPresence
Inheritance
SocketUser
Implements
Derived
Inherited Members
Extension Methods

Constructors

SocketUser(KookSocketClient, ulong)

Initializes a new WebSocket-based user.

protected SocketUser(KookSocketClient kook, ulong id)

Parameters

kook KookSocketClient

The WebSocket client.

id ulong

The identifier of the user.

Properties

ActiveClient

Gets the type of the client where this user is currently active.

public ClientType? ActiveClient { get; }

Property Value

ClientType?

Avatar

Gets the link to this user's avatar.

public abstract string Avatar { get; }

Property Value

string

Banner

Gets the link to this user's banner.

public abstract string? Banner { get; }

Property Value

string

BuffAvatar

Gets the link to this user's BUFF avatar.

public abstract string? BuffAvatar { get; }

Property Value

string

HasAnnualBuff

Gets whether this user's BUFF subscription is annual; null if unknown.

public abstract bool? HasAnnualBuff { get; }

Property Value

bool?

HasBuff

Gets whether this user has subscribed to BUFF; null if unknown.

public abstract bool? HasBuff { get; }

Property Value

bool?

IdentifyNumber

Gets the per-username unique ID for this user.

public string IdentifyNumber { get; }

Property Value

string

IdentifyNumberValue

Gets the per-username unique ID for this user.

public abstract ushort IdentifyNumberValue { get; }

Property Value

ushort

IsBanned

Gets whether this user is banned; null if unknown.

public abstract bool? IsBanned { get; }

Property Value

bool?

IsBot

Gets whether this user is a bot; null if unknown.

public abstract bool? IsBot { get; }

Property Value

bool?

IsDenoiseEnabled

Gets whether this user enabled denoise feature; null if unknown.

public abstract bool? IsDenoiseEnabled { get; }

Property Value

bool?

IsOnline

Gets the current status of this user.

public bool? IsOnline { get; }

Property Value

bool?

IsSystemUser

Gets whether this user is a system user.

public bool IsSystemUser { get; }

Property Value

bool

KMarkdownMention

Returns a special string used to mention this object in KMarkdown formatted text.

public string KMarkdownMention { get; }

Property Value

string

A string that is recognized by Kook as a mention in KMarkdown formatted text.

Nameplates

Gets the nameplates this user has.

public abstract IReadOnlyCollection<Nameplate> Nameplates { get; }

Property Value

IReadOnlyCollection<Nameplate>

PlainTextMention

Returns a special string used to mention this object in plain text formatted text.

public string PlainTextMention { get; }

Property Value

string

A string that is recognized by Kook as a mention in plain text formatted text.

UserTag

Get the tag this user has.

public abstract UserTag? UserTag { get; }

Property Value

UserTag

Username

Gets the username for this user.

public abstract string Username { get; }

Property Value

string

Methods

BlockAsync(RequestOptions?)

Gets the friend state with this user.

public Task BlockAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous operation for getting the friend state.

CreateDMChannelAsync(RequestOptions?)

Creates the direct message channel of this user.

public Task<SocketDMChannel> CreateDMChannelAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<SocketDMChannel>

A task that represents the asynchronous operation for getting or creating a DM channel. The task result contains the DM channel associated with this user.

Remarks

This method is used to obtain or create a channel used to send a direct message.

warning

In event that the current user cannot send a message to the target user, a channel can and will still be created by Kook. However, attempting to send a message will yield a HttpException with a 403 as its HttpCode. There are currently no official workarounds by Kook.

GetIntimacyAsync(RequestOptions?)

Gets the intimacy information with this user.

public Task<RestIntimacy> GetIntimacyAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<RestIntimacy>

A task that represents the asynchronous operation for getting the intimacy information. The task result contains the intimacy information associated with this user.

RemoveFriendAsync(RequestOptions?)

Gets the friend state with this user.

public Task RemoveFriendAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous operation for getting the friend state.

RequestFriendAsync(RequestOptions?)

Sends a friend request to this user.

public Task RequestFriendAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous operation for sending the friend request.

ToString()

Gets the full name of the user (e.g. Example#0001).

public override string ToString()

Returns

string

The full name of the user.

UnblockAsync(RequestOptions?)

Gets the friend state with this user.

public Task UnblockAsync(RequestOptions? options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous operation for getting the friend state.

UpdateIntimacyAsync(Action<IntimacyProperties>, RequestOptions?)

Updates the intimacy information with this user.

public Task UpdateIntimacyAsync(Action<IntimacyProperties> func, RequestOptions? options = null)

Parameters

func Action<IntimacyProperties>

A delegate containing the properties to modify the IIntimacy with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous operation for updating the intimacy information.