Class DiscordUser
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
Represents a Discord user.
public class DiscordUser : SnowflakeObject, IEquatable<DiscordUser>
- Inheritance
-
DiscordUser
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
- AccessToken
Gets the user's access token.
Can be used in combination with DiscordOAuth2Client.
You can generate a token object from json with FromJson(string), if needed.
As alternative you can construct the object via
.new DiscordAccessToken(string accessToken, string tokenType, int expiresIn, string refreshToken, string scope)
- AvatarDecorationData
Gets the user's avatar decoration data.
- AvatarDecorationUrl
Gets the user's avatar decoration url.
- AvatarHash
Gets the user's avatar hash.
- AvatarUrl
Gets the user's avatar url.
- BannerColor
Gets the user's banner color, if set. Mutually exclusive with BannerHash.
- BannerHash
Gets the user's banner hash. Mutually exclusive with BannerColor.
- BannerUrl
Gets the user's banner url
- Bio
Gets the users bio. This is not available to bots tho.
- Clan
Gets the users clan.
- DefaultAvatarUrl
Gets the URL of default avatar for this user.
- Discriminator
Gets the user's 4-digit discriminator.
Gets the user's email address.
This is only present in OAuth.
- Flags
Gets the user's flags.
- GlobalName
Gets this user's global name. Only applicable if IsMigrated is true.
- IsActiveDeveloper
Whether this member is a ActiveDeveloper
- IsBot
Gets whether the user is a bot.
- IsBotDev
Whether this member is a VerifiedDeveloper
- IsCurrent
Gets whether this user is the Client which created this object.
- IsMigrated
Whether this user account is migrated to the new username system.
Learn more at dis.gd/usernames.
- IsMod
Whether this member is a CertifiedModerator
- IsSystem
Gets whether the user is an official Discord system user.
- IsVerifiedBot
Whether this member is a VerifiedBot
- Locale
Gets the user's chosen language
- Mention
Gets the user's mention string.
- MfaEnabled
Gets whether the user has multi-factor authentication enabled.
- OAuthFlags
Gets the user's flags for OAuth.
- PremiumType
Gets the user's premium type.
- Presence
Gets this user's presence.
- ProfileUri
Returns a uri to this users profile.
- ProfileUrl
Returns a string representing the direct URL to this users profile.
- Pronouns
Gets the user's pronouns.
- ThemeColors
Gets the user's theme colors, if set.
- Username
Gets this user's username.
- UsernameWithDiscriminator
Gets this user's username with the discriminator. Example: Discord#0000
- UsernameWithGlobalName
Gets the username with the global name. Example: @lulalaby (Lala Sabathil)
- Verified
Gets whether the user is verified.
This is only present in OAuth.
Methods
- ConvertToMember(DiscordGuild)
Returns the DiscordMember in the specified DiscordGuild
- CreateDmChannelAsync()
Creates a direct message channel to this user.
- Equals(DiscordUser)
Checks whether this DiscordUser is equal to another DiscordUser.
- Equals(object)
Checks whether this DiscordUser is equal to another object.
- GetAvatarUrl(MediaFormat, ushort)
Gets the user's avatar URL, in requested format and size.
- GetFromApiAsync()
Fetches the user from the API.
- GetHashCode()
Gets the hash code for this DiscordUser.
- GetRpcInfoAsync()
Gets additional information about an application if the user is an bot.
- IsInGuild(DiscordGuild)
Whether this user is in a DiscordGuild
- IsNotInGuild(DiscordGuild)
Whether this user is not in a DiscordGuild
- OAuth2AddToGuildAsync(DiscordOAuth2Client, DiscordGuild, string?, IEnumerable<DiscordRole>?, bool?, bool?)
Adds the user to the given
guild
.Some parameters might need additional permissions for the bot on the target guild. See https://discord.com/developers/docs/resources/guild#add-guild-member for details.
- OAuth2AddToGuildAsync(DiscordOAuth2Client, ulong, string?, IEnumerable<DiscordRole>?, bool?, bool?)
Adds the user to the given
guildId
.Some parameters might need additional permissions for the bot on the target guild. See https://discord.com/developers/docs/resources/guild#add-guild-member for details.
- OAuth2GetApplicationRoleConnectionAsync(DiscordOAuth2Client)
Gets the current user's application role connection.
Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetAsync(DiscordOAuth2Client)
Gets the current user's oauth2 object.
Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetAuthorizationInfoAsync(DiscordOAuth2Client)
Gets the current user's authorization info.
Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetConnectionsAsync(DiscordOAuth2Client)
Gets the current user's connections.
Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetGuildAsync(DiscordOAuth2Client)
Gets the current user's guilds.
Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetGuildMemberAsync(DiscordOAuth2Client, DiscordGuild)
Gets the current user's member object for given
guild
.Requires a DiscordAccessToken set in AccessToken.
- OAuth2GetGuildMemberAsync(DiscordOAuth2Client, ulong)
Gets the current user's member object for given
guildId
.Requires a DiscordAccessToken set in AccessToken.
- OAuth2UpdateApplicationRoleConnectionAsync(DiscordOAuth2Client, string, string, ApplicationRoleConnectionMetadata)
Updates the current user's application role connection.
Requires a DiscordAccessToken set in AccessToken.
- SendMessageAsync(DiscordEmbed)
Sends a direct message to this user. Creates a direct message channel if one does not exist already.
- SendMessageAsync(DiscordMessageBuilder)
Sends a direct message to this user. Creates a direct message channel if one does not exist already.
- SendMessageAsync(string)
Sends a direct message to this user. Creates a direct message channel if one does not exist already.
- SendMessageAsync(string, DiscordEmbed)
Sends a direct message to this user. Creates a direct message channel if one does not exist already.
- ToString()
Returns a string representation of this user.
- UnbanAsync(DiscordGuild, string?)
Unbans this user from a guild.
Operators
- operator ==(DiscordUser?, DiscordUser?)
Gets whether the two DiscordUser objects are equal.
- operator !=(DiscordUser?, DiscordUser?)
Gets whether the two DiscordUser objects are not equal.