Table of Contents

Class RestSelfUser

Namespace
Discord.Rest
Assembly
Discord.Net.Rest.dll

Represents the logged-in REST-based user.

public class RestSelfUser : RestUser, IUpdateable, ISelfUser, IUser, ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence
Inheritance
RestSelfUser
Implements
Inherited Members
Extension Methods

Properties

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.

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.

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.

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

Exceptions

InvalidOperationException

Unable to modify this object using a different token.

UpdateAsync(RequestOptions)

Updates this object's properties with its current state.

public override Task UpdateAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

Exceptions

InvalidOperationException

Unable to update this object using a different token.