Skip to main content

Interface IUser

Represents a generic user.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface IUser : ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence

Properties​

AvatarId​

Gets the identifier of this user's avatar.

View Source​
Declaration
string AvatarId { get; }

Discriminator​

Gets the per-username unique ID for this user.

View Source​
Declaration
string Discriminator { get; }

DiscriminatorValue​

Gets the per-username unique ID for this user.

View Source​
Declaration
ushort DiscriminatorValue { get; }

IsBot​

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

View Source​
Declaration
bool IsBot { get; }

IsWebhook​

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

View Source​
Declaration
bool IsWebhook { get; }

Username​

Gets the username for this user.

View Source​
Declaration
string Username { get; }

PublicFlags​

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

View Source​
Declaration
UserProperties? PublicFlags { get; }

Methods​

GetAvatarUrl(ImageFormat, UInt16)​

Gets the avatar URL for this user.

View Source​
Declaration
string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
Returns​

System.String: A string representing the user's avatar URL; null if the user does not have an avatar in place.

Parameters​
TypeNameDescription
Discord.ImageFormatformatThe format to return.
System.UInt16sizeThe size of the image to return in. This can be any power of two between 16 and 2048.

GetDefaultAvatarUrl()​

Gets the default avatar URL for this user.

View Source​
Declaration
string GetDefaultAvatarUrl()
Returns​

System.String: A string representing the user's avatar URL.

CreateDMChannelAsync(RequestOptions)​

Creates the direct message channel of this user.

View Source​
Declaration
Task<IDMChannel> CreateDMChannelAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.IDMChannel>: 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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Extension Methods​

  • Discord.IUser.Discord.UserExtensions.SendMessageAsync(System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.AllowedMentions,Discord.MessageComponent,Discord.Embed[])
  • Discord.IUser.Discord.UserExtensions.SendFileAsync(System.IO.Stream,System.String,System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed[])
  • Discord.IUser.Discord.UserExtensions.SendFileAsync(System.String,System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed[])