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.
See Also:
  • Constructor Details

    • ResolvedMember

      public ResolvedMember(GatewayDiscordClient gateway, discord4j.discordjson.json.ResolvedMemberData data, discord4j.discordjson.json.UserData user, long guildId)
      Constructs a ResolvedMember with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient 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 Details

    • 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

      @Deprecated public String getNicknameMention()
      Deprecated.
      This type of ping has been deprecated in the Discord API.
      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 full Member instance corresponding to this resolved member.
      Returns:
      a Mono where, upon successful completion, emits the full Member instance corresponding to this resolved member. If an error is received, it is emitted through the Mono.
    • asFullMember

      public Mono<Member> asFullMember(EntityRetrievalStrategy retrievalStrategy)
      Retrieves the full Member instance corresponding to this resolved member, using the given retrieval strategy.
      Returns:
      a Mono where, upon successful completion, emits the full Member instance corresponding to this resolved member. If an error is received, it is emitted through the Mono.
    • getClient

      public GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      Returns:
      The GatewayDiscordClient associated to this object.
    • toString

      public String toString()
      Overrides:
      toString in class Object