java.lang.Object
java.lang.Record
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.core.YUser

public record YUser(net.dv8tion.jda.api.entities.User user) extends Record
  • Constructor Details

    • YUser

      public YUser(net.dv8tion.jda.api.entities.User user)
      Creates an instance of a YUser record class.
      Parameters:
      user - the value for the user record component
  • Method Details

    • getUserTag

      @Nonnull public String getUserTag()
      See Also:
      • User.getAsTag()
    • getUserId

      @Nonnull public String getUserId()
      See Also:
      • ISnowflake.getId()
    • getUserIdLong

      @Nonnull public Long getUserIdLong()
      See Also:
      • ISnowflake.getIdLong()
    • getName

      @Nonnull public String getName()
      See Also:
      • User.getName()
    • isBot

      @Nonnull public Boolean isBot()
      See Also:
      • User.isBot()
    • getDiscriminator

      @Nonnull public String getDiscriminator()
      See Also:
      • User.getDiscriminator()
    • getAvatarId

      @Nullable public @Nullable String getAvatarId()
      See Also:
      • User.getAvatarId()
    • getAvatarUrl

      @Nullable public @Nullable String getAvatarUrl()
      See Also:
      • User.getAvatarUrl()
    • getDefaultAvatarId

      @Nonnull public String getDefaultAvatarId()
      See Also:
      • User.getDefaultAvatarId()
    • getDefaultAvatarUrl

      @NotNull public @NotNull String getDefaultAvatarUrl()
      The URL for the user's default avatar image.
      Returns:
      Never-null String containing the User default avatar url.
      Throws:
      UnsupportedOperationException - If this User was created with from id
    • getEffectiveAvatarUrl

      @Nonnull public String getEffectiveAvatarUrl()
      See Also:
      • User.getDefaultAvatarUrl()
    • retrieveProfile

      @NotNull public @NotNull net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.User.Profile> retrieveProfile()
      Loads the user's User.Profile data. Returns a completed RestAction if this User has been retrieved using JDA.retrieveUserById(long).
      Returns:
      RestAction - Type: User.Profile
      Throws:
      UnsupportedOperationException - If this User was created with from id
      Since:
      4.3.0
    • getAsTag

      @NotNull public @NotNull String getAsTag()
      The "tag" for this user

      This is the equivalent of calling String.format("%#s", user)

      Returns:
      Never-null String containing the tag for this user, for example DV8FromTheWorld#6297
      Throws:
      UnsupportedOperationException - If this User was created with fromId(long)
    • hasPrivateChannel

      public boolean hasPrivateChannel()
      See Also:
      • User.hasPrivateChannel()
    • openPrivateChannel

      @Nonnull public net.dv8tion.jda.api.requests.RestAction<net.dv8tion.jda.api.entities.PrivateChannel> openPrivateChannel()
      See Also:
      • User.openPrivateChannel()
    • getMutualGuilds

      @Nonnull public List<net.dv8tion.jda.api.entities.Guild> getMutualGuilds()
      See Also:
      • User.getMutualGuilds()
    • isSystem

      public boolean isSystem()
      See Also:
      • User.isSystem()
    • getJDA

      @Nonnull public net.dv8tion.jda.api.JDA getJDA()
      See Also:
      • User.getJDA()
    • getFlags

      @Nonnull public Set<net.dv8tion.jda.api.entities.User.UserFlag> getFlags()
      See Also:
      • User.getFlags()
    • getFlagsRaw

      public int getFlagsRaw()
      See Also:
      • User.getFlagsRaw()
    • getAsMention

      @Nonnull public String getAsMention()
      See Also:
      • IMentionable.getAsMention()
    • getBot

      @Nonnull public YBot getBot()
      See Also:
    • getTimeCreated

      @NotNull public @NotNull OffsetDateTime getTimeCreated()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • user

      public net.dv8tion.jda.api.entities.User user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component