Package discord4j.rest.entity
Class RestUser
java.lang.Object
discord4j.rest.entity.RestUser
Represents a user (bot or normal) entity in Discord. Users can spawn across the entire platform, be members of
guilds, participate in text and voice chat, and much more.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RestUsercreate(RestClient restClient, Snowflake id) Create aRestUserfor a given ID.booleanMono<discord4j.discordjson.json.UserData>getData()Retrieve this user's data upon subscription.getId()Returns the ID of this user.final Mono<discord4j.discordjson.json.ChannelData>Requests to retrieve the private channel (DM) to this user.inthashCode()
-
Method Details
-
create
Create aRestUserfor a given ID. This method does not perform any API request.- Parameters:
restClient- the client to make API requestsid- the ID of this entity- Returns:
- a
RestUserrepresented by thisid.
-
getId
Returns the ID of this user.- Returns:
- The ID of this user
-
getData
Retrieve this user's data upon subscription.- Returns:
- a
Monowhere, upon successful completion, emits theUserDatabelonging to this user. If an error is received, it is emitted through theMono.
-
getPrivateChannel
Requests to retrieve the private channel (DM) to this user.- Returns:
- A
Monowhere, upon successful completion, emits theprivate channelto this user. If an error is received, it is emitted through theMono.
-
equals
-
hashCode
public int hashCode()
-