Table of Contents

Class SocketSelfUser

Namespace
Discord.WebSocket
Assembly
Discord.Net.WebSocket.dll

Represents the logged-in WebSocket-based user.

public class SocketSelfUser : SocketUser, ISelfUser, IUser, ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence
Inheritance
SocketSelfUser
Implements
Inherited Members
Extension Methods

Properties

AvatarId

Gets the identifier of this user's avatar.

public override string AvatarId { get; }

Property Value

string

BannerColor

Gets the color of the banner.

public Color? BannerColor { get; }

Property Value

Color?

Remarks

null if the user has no banner set.

BannerId

Gets the hash of the banner.

public string BannerId { get; }

Property Value

string

Remarks

null if the user has no banner set.

DiscriminatorValue

Gets the per-username unique ID for this user. This will return 0 for users who have migrated to new username system.

public override ushort DiscriminatorValue { get; }

Property Value

ushort

Email

Gets the email associated with this user.

public string Email { get; }

Property Value

string

Flags

Gets the flags that are applied to a user's account.

public UserProperties Flags { get; }

Property Value

UserProperties

The value of flags for this user.

Remarks

This value is determined by bitwise OR-ing UserProperties values together.

GlobalName

Gets the user's display name, if it is set. For bots, this will get the application name.

public override string GlobalName { get; }

Property Value

string

Remarks

This property will be null if user has no display name set.

IsBot

Gets a value that indicates whether this user is identified as a bot.

public override bool IsBot { get; }

Property Value

bool

true if the user is a bot application; otherwise false.

Remarks

This property retrieves a value that indicates whether this user is a registered bot application (indicated by the blue BOT tag within the official chat client).

IsMfaEnabled

Indicates whether or not this user has MFA enabled on their account.

public bool IsMfaEnabled { get; }

Property Value

bool

true if this user has enabled multi-factor authentication on their account; false if not.

IsVerified

Indicates whether or not this user has their email verified.

public bool IsVerified { get; }

Property Value

bool

true if this user's email has been verified; false if not.

IsWebhook

Gets a value that indicates whether this user is a webhook user.

public override bool IsWebhook { get; }

Property Value

bool

true if the user is a webhook; otherwise false.

Locale

Gets the user's chosen language option.

public string Locale { get; }

Property Value

string

The IETF language tag of the user's chosen region, if provided. For example, a locale of "English, US" is "en-US", "Chinese (Taiwan)" is "zh-TW", etc.

PremiumType

Gets the type of Nitro subscription that is active on this user's account.

public PremiumType PremiumType { get; }

Property Value

PremiumType

The type of Nitro subscription the user subscribes to, if any.

Remarks

This information may only be available with the identify OAuth scope.

Username

Gets the username for this user.

public override string Username { get; }

Property Value

string

Methods

ModifyAsync(Action<SelfUserProperties>, RequestOptions)

Modifies the user's properties.

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

Parameters

func Action<SelfUserProperties>
options RequestOptions

Returns

Task