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 Details

    • create

      public static RestUser create(RestClient restClient, Snowflake id)
      Create a RestUser for a given ID. This method does not perform any API request.
      Parameters:
      restClient - the client to make API requests
      id - the ID of this entity
      Returns:
      a RestUser represented by this id.
    • 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 Mono where, upon successful completion, emits the UserData belonging to this user. If an error is received, it is emitted through the Mono.
    • getPrivateChannel

      public final Mono<discord4j.discordjson.json.ChannelData> getPrivateChannel()
      Requests to retrieve the private channel (DM) to this user.
      Returns:
      A Mono where, upon successful completion, emits the private channel to this user. If an error is received, it is emitted through the Mono.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object