Package com.mewna.catnip.entity.user
Interface User
- All Superinterfaces:
Entity
,Mentionable
,Snowflake
,Timestamped
- All Known Subinterfaces:
ApplicationOwner
- All Known Implementing Classes:
ApplicationOwnerImpl
,UserImpl
A single Discord user.
- Since:
- 9/4/18
- Author:
- amy
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Whether the user's avatar is animated.default String
avatar()
User's avatar hash.The URL for the user's set avatar.avatarUrl
(ImageOptions options) The URL for the user's set avatar.banner()
boolean
bot()
Whether the user is a bot, or webhook/fake user.default io.reactivex.rxjava3.core.Single<DMChannel>
createDM()
Creates a DM channel with this user.The URL for the default avatar for this user.default String
The DiscordTag of the user, which is the username, an hash, and the discriminator.Discriminator of the user, used to tell Amy#0001 from Amy#0002.The URL for the user's effective avatar, as displayed in the Discord client.effectiveAvatarUrl
(ImageOptions options) The URL for the user's effective avatar, as displayed in the Discord client.default String
effectiveName
(Guild guild) The user's effective name shown in a guild.default io.reactivex.rxjava3.core.Maybe<Presence>
presence()
The public flags on a user's account.username()
The username of the user.Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
animatedAvatar
@CheckReturnValue boolean animatedAvatar()Whether the user's avatar is animated.- Returns:
- True if the avatar is animated, false otherwise.
-
defaultAvatarUrl
The URL for the default avatar for this user.- Returns:
- String containing the URL to the default avatar. Never null.
-
avatarUrl
The URL for the user's set avatar. Can be null if the user has not set an avatar.- Parameters:
options
-Image Options
.- Returns:
- String containing the URL to their avatar, options considered. Can be null.
- See Also:
-
avatarUrl
The URL for the user's set avatar. Can be null if the user has not set an avatar.- Returns:
- String containing the URL to their avatar. Can be null.
- See Also:
-
effectiveAvatarUrl
The URL for the user's effective avatar, as displayed in the Discord client.
Convenience method for getting the user's default avatar whenavatarUrl()
is null.- Parameters:
options
-Image Options
.- Returns:
- String containing a URL to their effective avatar, options considered. Never null.
-
effectiveAvatarUrl
The URL for the user's effective avatar, as displayed in the Discord client.
Convenience method for getting the user's default avatar whenavatarUrl()
is null.- Returns:
- String containing a URL to their effective avatar. Never null.
-
username
The username of the user.- Returns:
- User's name. Never null.
-
effectiveName
The user's effective name shown in a guild.- Returns:
- User's nickname in the guild, if set, otherwise the username.
-
discriminator
Discriminator of the user, used to tell Amy#0001 from Amy#0002.- Returns:
- 4 digit discriminator as a string. Never null.
-
discordTag
The DiscordTag of the user, which is the username, an hash, and the discriminator.- Returns:
- User's DiscordTag. Never null.
-
avatar
User's avatar hash.
This does not return their avatar URL nor image directly.- Returns:
- User's hashed avatar string. Can be null.
- See Also:
-
bot
@CheckReturnValue boolean bot()Whether the user is a bot, or webhook/fake user.- Returns:
- True if the user is a bot, false if the user is a human.
-
publicFlags
The public flags on a user's account. Public flags are a currently-undocumented subset of all user flags.- Returns:
- The public flags on a user's account.
-
accentColor
@CheckReturnValue int accentColor()- Returns:
- The user's profile accent colour.
-
banner
- Returns:
- The hash of the user's banner if it exists
-
presence
- Returns:
- The user's presence, or
null
if no presence is cached.
-
createDM
Creates a DM channel with this user.- Returns:
- Future with the result of the DM creation.
-
asMention
- Specified by:
asMention
in interfaceMentionable
- Returns:
- A mention for this entity that can be sent in a message.
-