Package discord4j.rest.entity
Class RestMember
java.lang.Object
discord4j.rest.entity.RestMember
Represents a user (bot or normal) that is member of a specific guild.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RestMembercreate(RestClient restClient, Snowflake guildId, Snowflake id) Create aRestMemberwith the given parameters.booleanMono<discord4j.discordjson.json.MemberData>getData()Requests to retrieve the Member'sMemberDataReturns the ID of the guild this member belongs to.Mono<discord4j.discordjson.json.RoleData>Requests to retrieve the member's highest guild role.getId()Returns the ID of this member.guild()Create aRestGuildwith data from this Member.inthashCode()hasHigherRoles(Collection<Snowflake> otherRoles) Requests to determine if the position of this member's highest role is greater than the highest position of the provided roles.Requests to determine if this member is nigher in the role hierarchy than the member as represented by the supplied ID or signalIllegalArgumentExceptionif the member as represented by the supplied ID is in a different guild than this member.isHigher(RestMember otherMember) Requests to determine if this member is higher in the role hierarchy than the provided member or signalIllegalArgumentExceptionif the provided member is in a different guild than this member.user()Create aRestUserwith daa from this Member.
-
Method Details
-
create
Create aRestMemberwith the given parameters. This method does not perform any API request.- Parameters:
restClient- REST API resourcesguildId- the ID of the guild this member belongs toid- the ID of this member- Returns:
- a
RestMemberrepresented by the given parameters.
-
getGuildId
Returns the ID of the guild this member belongs to.- Returns:
- The ID of the the guild this member belongs to.
-
getId
Returns the ID of this member.- Returns:
- The ID of this member
-
guild
Create aRestGuildwith data from this Member. This method does not perform any API request.- Returns:
- a
RestGuildrepresented by the data from this Member
-
user
Create aRestUserwith daa from this Member. This method does not perform any API request.- Returns:
- a
RestUserrepresented by the data from this Member
-
getData
Requests to retrieve the Member'sMemberData- Returns:
- A
Monowhere, upon successful completion, emits the Member'sMemberData. If an error is received, it is emitted through the Mono.
-
getHighestRole
Requests to retrieve the member's highest guild role.The highest role is defined to be the role with the highest position, based on Discord's ordering. This is the role that appears at the top in Discord's UI.
- Returns:
- A
Monowhere, upon successful completion, emits the member's highestrole. If an error is received, it is emitted through theMono.
-
isHigher
Requests to determine if this member is higher in the role hierarchy than the provided member or signalIllegalArgumentExceptionif the provided member is in a different guild than this member.- Parameters:
otherMember- The member to compare in the role hierarchy with this member.- Returns:
- A
Monowhere, upon successful completion, emitstrueif this member is higher in the role hierarchy than the provided member,falseotherwise. If an error is received, it is emitted through the @{code Mono}.
-
isHigher
Requests to determine if this member is nigher in the role hierarchy than the member as represented by the supplied ID or signalIllegalArgumentExceptionif the member as represented by the supplied ID is in a different guild than this member. This is determined by the positions of each of the members' highest roles.- Parameters:
id- The ID of the member to compare in the role hierarchy with this member.- Returns:
- A
Monowhere, upon successful completion, emitstrueif this member is higher in the role hierarchy than the member as represented by the supplied ID,falseotherwise. If an error is received, it is emitted through theMono.
-
hasHigherRoles
Requests to determine if the position of this member's highest role is greater than the highest position of the provided roles.The behavior of this operation is undefined if a given role is from a different guild.
- Parameters:
otherRoles- The collection of roles to compare in the role hierarchy with this member's roles.- Returns:
- A
Monowhere, upon successful completion, emitstrueif the position of this member's highest role is greater than the highest position of the provided roles,falseotherwise. If an error is received, it is emitted through theMono.
-
equals
-
hashCode
public int hashCode()
-