Package discord4j.core.object.command
Class ResolvedMember
- java.lang.Object
-
- discord4j.core.object.command.ResolvedMember
-
- All Implemented Interfaces:
DiscordObject
@Experimental public class ResolvedMember extends Object implements DiscordObject
A Discord member that was resolved in a command.
-
-
Constructor Summary
Constructors Constructor Description ResolvedMember(GatewayDiscordClient gateway, discord4j.discordjson.json.ResolvedMemberData data, discord4j.discordjson.json.UserData user, long guildId)
Constructs aResolvedMember
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Member>
asFullMember()
Retrieves the fullMember
instance corresponding to this resolved member.Mono<Member>
asFullMember(EntityRetrievalStrategy retrievalStrategy)
Retrieves the fullMember
instance corresponding to this resolved member, using the given retrieval strategy.GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.ResolvedMemberData
getData()
Returns the raw data as represented by Discord.String
getDisplayName()
Gets the name that is displayed in client.PermissionSet
getEffectivePermissions()
Gets the total permissions of the member in the channel, including overwrites.Snowflake
getGuildId()
Gets the ID of the guild this user is associated to.Snowflake
getId()
Gets the ID of this member.Instant
getJoinTime()
Gets when the user joined the guild.Optional<String>
getNickname()
Gets the user's guild nickname (if one is set).String
getNicknameMention()
Gets the raw nickname mention.Optional<Instant>
getPremiumTime()
Gets when the user started boosting the server, if present.Set<Snowflake>
getRoleIds()
Gets the user's guild roles' IDs.String
toString()
-
-
-
Constructor Detail
-
ResolvedMember
public ResolvedMember(GatewayDiscordClient gateway, discord4j.discordjson.json.ResolvedMemberData data, discord4j.discordjson.json.UserData user, long guildId)
Constructs aResolvedMember
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.user
- The raw user associated to the member, must be non-null.guildId
- the ID of the guild the user is member of
-
-
Method Detail
-
getData
public discord4j.discordjson.json.ResolvedMemberData getData()
Returns the raw data as represented by Discord.- Returns:
- the raw data
-
getId
public Snowflake getId()
Gets the ID of this member.- Returns:
- The ID of this member;
-
getGuildId
public Snowflake getGuildId()
Gets the ID of the guild this user is associated to.- Returns:
- The ID of the guild this user is associated to.
-
getRoleIds
public Set<Snowflake> getRoleIds()
Gets the user's guild roles' IDs.- Returns:
- The user's guild roles' IDs.
-
getJoinTime
public Instant getJoinTime()
Gets when the user joined the guild.- Returns:
- When the user joined the guild.
-
getPremiumTime
public Optional<Instant> getPremiumTime()
Gets when the user started boosting the server, if present.- Returns:
- When the user started boosting the server, if present.
-
getDisplayName
public String getDisplayName()
Gets the name that is displayed in client.- Returns:
- The name that is displayed in client.
-
getNickname
public Optional<String> getNickname()
Gets the user's guild nickname (if one is set).- Returns:
- The user's guild nickname (if one is set).
-
getNicknameMention
public String getNicknameMention()
Gets the raw nickname mention. This is the format utilized to directly mention another user (assuming the user exists in context of the mention).- Returns:
- The raw nickname mention.
-
getEffectivePermissions
public PermissionSet getEffectivePermissions()
Gets the total permissions of the member in the channel, including overwrites.- Returns:
- The permissions of the member.
-
asFullMember
public Mono<Member> asFullMember()
Retrieves the fullMember
instance corresponding to this resolved member.
-
asFullMember
public Mono<Member> asFullMember(EntityRetrievalStrategy retrievalStrategy)
Retrieves the fullMember
instance corresponding to this resolved member, using the given retrieval strategy.
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
-