Package org.javacord.core.entity.user
Interface Member
-
- All Superinterfaces:
DiscordEntity
,Mentionable
,Messageable
,Permissionable
- All Known Implementing Classes:
MemberImpl
public interface Member extends DiscordEntity, Messageable, Mentionable, Permissionable
A member of a server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getDisplayName()
Gets the display name of this member.java.time.Instant
getJoinedAtTimestamp()
Gets the timestamp of when this member joined the server.default java.lang.String
getMentionTag()
java.util.Optional<java.lang.String>
getNickname()
Gets the nickname of this member.java.util.Optional<java.awt.Color>
getRoleColor()
Gets the displayed color of this member based on his roles.java.util.List<Role>
getRoles()
Gets a sorted list (by position) with all roles of this member.Server
getServer()
Gets the server, this user is a part of.java.util.Optional<Icon>
getServerAvatar()
Gets the member's server avatar.java.util.Optional<Icon>
getServerAvatar(int size)
Gets the member's server avatar in the given size.java.util.Optional<java.lang.String>
getServerAvatarHash()
Gets the member's server avatar hash.java.util.Optional<java.time.Instant>
getServerBoostingSinceTimestamp()
Gets the timestamp of when this member started boosting the server.java.util.Optional<java.time.Instant>
getTimeout()
Gets the timestamp of the timeout when the timeout will expire and the user will be able to communicate in the server again.User
getUser()
Gets the user object linked to this member.boolean
hasRole(Role role)
Checks if this member has the given role.boolean
isDeafened()
Gets the deafened state of this member.boolean
isMuted()
Gets the muted state of this member.boolean
isPending()
Gets the pending state of this member.boolean
isSelfDeafened()
Gets the self-deafened state of this member.boolean
isSelfMuted()
Gets the self-muted state of this member.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.entity.message.Messageable
sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage
-
-
-
-
Method Detail
-
getMentionTag
default java.lang.String getMentionTag()
- Specified by:
getMentionTag
in interfaceMentionable
-
getDisplayName
default java.lang.String getDisplayName()
Gets the display name of this member.- Returns:
- The display name of this member.
-
getServer
Server getServer()
Gets the server, this user is a part of.- Returns:
- The server.
-
getUser
User getUser()
Gets the user object linked to this member.- Returns:
- The user.
-
getNickname
java.util.Optional<java.lang.String> getNickname()
Gets the nickname of this member.- Returns:
- The nickname of this member.
-
getRoles
java.util.List<Role> getRoles()
Gets a sorted list (by position) with all roles of this member.- Returns:
- A sorted list (by position) with all roles of this member.
-
hasRole
boolean hasRole(Role role)
Checks if this member has the given role.- Parameters:
role
- The role to check.- Returns:
- Whether the member has the role or not.
-
getRoleColor
java.util.Optional<java.awt.Color> getRoleColor()
Gets the displayed color of this member based on his roles.- Returns:
- The color.
-
getServerAvatarHash
java.util.Optional<java.lang.String> getServerAvatarHash()
Gets the member's server avatar hash.- Returns:
- The member's server avatar hash.
-
getServerAvatar
java.util.Optional<Icon> getServerAvatar()
Gets the member's server avatar.- Returns:
- The member's server avatar.
-
getServerAvatar
java.util.Optional<Icon> getServerAvatar(int size)
Gets the member's server avatar in the given size.- Parameters:
size
- The size of the image, must be any power of 2 between 16 and 4096.- Returns:
- The member's server avatar in the given size.
-
getJoinedAtTimestamp
java.time.Instant getJoinedAtTimestamp()
Gets the timestamp of when this member joined the server.- Returns:
- The timestamp of when this member joined the server.
-
getServerBoostingSinceTimestamp
java.util.Optional<java.time.Instant> getServerBoostingSinceTimestamp()
Gets the timestamp of when this member started boosting the server.- Returns:
- The timestamp of when this member started boosting the server.
-
isMuted
boolean isMuted()
Gets the muted state of this member.- Returns:
- Whether or not this member is muted.
-
isDeafened
boolean isDeafened()
Gets the deafened state of this member.- Returns:
- Whether or not this member is deafened.
-
isSelfMuted
boolean isSelfMuted()
Gets the self-muted state of this member.- Returns:
- Whether this member is self-muted.
-
isSelfDeafened
boolean isSelfDeafened()
Gets the self-deafened state of this member.- Returns:
- Whether this member is self-deafened.
-
isPending
boolean isPending()
Gets the pending state of this member.- Returns:
- Whether this user has passed the membership screening.
-
getTimeout
java.util.Optional<java.time.Instant> getTimeout()
Gets the timestamp of the timeout when the timeout will expire and the user will be able to communicate in the server again. The returned Instant may be in the past which indicates that the user is not timed out.- Returns:
- The timestamp of when this member will no longer be timed out.
-
-