Package discord4j.rest.entity
Class RestUser
- java.lang.Object
-
- discord4j.rest.entity.RestUser
-
public class RestUser extends Object
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RestUsercreate(RestClient restClient, Snowflake id)Create aRestUserfor a given ID.booleanequals(Object o)Mono<discord4j.discordjson.json.UserData>getData()Retrieve this user's data upon subscription.SnowflakegetId()Returns the ID of this user.Mono<discord4j.discordjson.json.ChannelData>getPrivateChannel()Requests to retrieve the private channel (DM) to this user.inthashCode()
-
-
-
Method Detail
-
create
public static RestUser create(RestClient restClient, Snowflake id)
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
public Snowflake getId()
Returns the ID of this user.- Returns:
- The ID of this user
-
getData
public Mono<discord4j.discordjson.json.UserData> 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
public final Mono<discord4j.discordjson.json.ChannelData> 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.
-
-