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 aResolvedMemberwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Member>asFullMember()Retrieves the fullMemberinstance corresponding to this resolved member.Mono<Member>asFullMember(EntityRetrievalStrategy retrievalStrategy)Retrieves the fullMemberinstance corresponding to this resolved member, using the given retrieval strategy.GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.discord4j.discordjson.json.ResolvedMemberDatagetData()Returns the raw data as represented by Discord.StringgetDisplayName()Gets the name that is displayed in client.PermissionSetgetEffectivePermissions()Gets the total permissions of the member in the channel, including overwrites.SnowflakegetGuildId()Gets the ID of the guild this user is associated to.SnowflakegetId()Gets the ID of this member.InstantgetJoinTime()Gets when the user joined the guild.Optional<String>getNickname()Gets the user's guild nickname (if one is set).StringgetNicknameMention()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.StringtoString()
-
-
-
Constructor Detail
-
ResolvedMember
public ResolvedMember(GatewayDiscordClient gateway, discord4j.discordjson.json.ResolvedMemberData data, discord4j.discordjson.json.UserData user, long guildId)
Constructs aResolvedMemberwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated 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 fullMemberinstance corresponding to this resolved member.
-
asFullMember
public Mono<Member> asFullMember(EntityRetrievalStrategy retrievalStrategy)
Retrieves the fullMemberinstance corresponding to this resolved member, using the given retrieval strategy.
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
-