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

public record YMember(net.dv8tion.jda.api.entities.Member member) extends Record
Represents a Guild-specific User.

Contains all guild-specific information about a User. (Roles, Nickname, VoiceStatus etc.)

Since:
3.0
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    YMember(net.dv8tion.jda.api.entities.Member member)
    Creates an instance of a YMember record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(int delDays)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    ban(int delDays, String reason)
     
    boolean
     
    boolean
    canInteract(net.dv8tion.jda.api.entities.Emote emote)
     
    boolean
    canInteract(net.dv8tion.jda.api.entities.Member member)
     
    boolean
    canInteract(net.dv8tion.jda.api.entities.Role role)
     
    boolean
    canSync(net.dv8tion.jda.api.entities.IPermissionContainer channel)
     
    boolean
    canSync(net.dv8tion.jda.api.entities.IPermissionContainer targetChannel, net.dv8tion.jda.api.entities.IPermissionContainer syncSource)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    deafen(boolean deafen)
     
    void
    deafen(@NotNull YMember member, @NotNull YReplyCallback callback)
     
    void
    deafen(@NotNull YReplyCallback callback)
     
    void
    deafen(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    void
    deafen(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    Set<net.dv8tion.jda.api.entities.ClientType>
     
    List<net.dv8tion.jda.api.entities.Activity>
     
     
    @NotNull net.dv8tion.jda.api.managers.AudioManager
     
    net.dv8tion.jda.api.entities.Member
     
    @Nullable String
     
     
     
    int
     
    net.dv8tion.jda.api.entities.BaseGuildMessageChannel
     
     
     
    long
     
    @NotNull net.dv8tion.jda.api.JDA
    The JDA instance.
     
     
     
     
    net.dv8tion.jda.api.OnlineStatus
     
    net.dv8tion.jda.api.OnlineStatus
    getOnlineStatus(net.dv8tion.jda.api.entities.ClientType type)
     
    Set<net.dv8tion.jda.api.Permission>
     
    Set<net.dv8tion.jda.api.Permission>
    getPermissions(net.dv8tion.jda.api.entities.GuildChannel channel)
     
    Set<net.dv8tion.jda.api.Permission>
    getPermissions(net.dv8tion.jda.api.entities.IPermissionContainer channel)
     
    Set<net.dv8tion.jda.api.Permission>
     
    Set<net.dv8tion.jda.api.Permission>
    getPermissionsExplicit(net.dv8tion.jda.api.entities.GuildChannel channel)
     
    Set<net.dv8tion.jda.api.Permission>
    getPermissionsExplicit(net.dv8tion.jda.api.entities.IPermissionContainer channel)
     
    List<net.dv8tion.jda.api.entities.Role>
     
     
     
     
    The time this Member will be released from time out.
     
    net.dv8tion.jda.api.entities.GuildVoiceState
     
    boolean
    hasAccess(net.dv8tion.jda.api.entities.GuildChannel channel)
     
    boolean
    hasAccess(net.dv8tion.jda.api.entities.IPermissionContainer channel)
     
    final int
    Returns a hash code value for this object.
    boolean
    hasPermission(Collection<net.dv8tion.jda.api.Permission> permissions)
     
    boolean
    hasPermission(net.dv8tion.jda.api.entities.GuildChannel channel, Collection<net.dv8tion.jda.api.Permission> permissions)
     
    boolean
    hasPermission(net.dv8tion.jda.api.entities.GuildChannel channel, net.dv8tion.jda.api.Permission... permissions)
     
    boolean
    hasPermission(net.dv8tion.jda.api.entities.IPermissionContainer channel, Collection<net.dv8tion.jda.api.Permission> permissions)
     
    boolean
    hasPermission(net.dv8tion.jda.api.entities.IPermissionContainer channel, net.dv8tion.jda.api.Permission... permissions)
     
    boolean
    hasPermission(net.dv8tion.jda.api.Permission permission)
     
    boolean
    hasPermission(net.dv8tion.jda.api.Permission... permissions)
     
    boolean
     
    boolean
    Returns whether a member is boosting the guild or not.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    Whether this Member is in time out.
    void
    joinVc(@NotNull YMember member, @NotNull YReplyCallback callback)
     
    void
    joinVc(@NotNull YReplyCallback callback)
     
    void
    joinVc(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    void
    joinVc(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    kick(String reason)
     
    void
    leaveVc(@NotNull YMember member, @NotNull YReplyCallback callback)
     
    void
    leaveVc(@NotNull YReplyCallback callback)
     
    void
    leaveVc(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    void
    leaveVc(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    net.dv8tion.jda.api.entities.Member
    Returns the value of the member record component.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    mute(boolean mute)
     
    void
    mute(@NotNull YMember member, @NotNull YReplyCallback callback)
     
    void
    mute(@NotNull YReplyCallback callback)
     
    void
    mute(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    void
    mute(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
     
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    Removes a time out from this Member in this Guild.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(long amount, TimeUnit unit)
    Puts this Member in time out in this Guild for a specific amount of time.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    timeoutFor(Duration duration)
    Puts this Member in time out in this Guild for a specific amount of time.
    net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>
    Puts this Member in time out in this Guild until the specified date.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • YMember

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

    • getUser

      @Contract(" -> new") @Nonnull public YUser getUser()
    • canInteract

      public boolean canInteract(@Nonnull net.dv8tion.jda.api.entities.Role role)
      See Also:
      • Member.canInteract(Role)
    • getGuild

      @Nonnull public YGuild getGuild()
      See Also:
      • Member.getGuild()
    • getJDA

      @NotNull public @NotNull net.dv8tion.jda.api.JDA getJDA()
      The JDA instance.
      Returns:
      The current JDA instance.
    • getTimeJoined

      @Nonnull public OffsetDateTime getTimeJoined()
      See Also:
      • Member.getTimeJoined()
    • hasTimeJoined

      public boolean hasTimeJoined()
      See Also:
      • Member.hasTimeJoined()
    • getTimeBoosted

      @Nullable public OffsetDateTime getTimeBoosted()
      See Also:
      • Member.getTimeBoosted()
    • isBoosting

      public boolean isBoosting()
      Returns whether a member is boosting the guild or not.
      Returns:
      True, if it is boosting
    • getVoiceState

      @Nullable public net.dv8tion.jda.api.entities.GuildVoiceState getVoiceState()
      See Also:
      • Member.getVoiceState()
    • getActivities

      @Nonnull public List<net.dv8tion.jda.api.entities.Activity> getActivities()
      See Also:
      • Member.getActivities()
    • getOnlineStatus

      @Nonnull public net.dv8tion.jda.api.OnlineStatus getOnlineStatus()
      See Also:
      • Member.getOnlineStatus()
    • getOnlineStatus

      @Nonnull public net.dv8tion.jda.api.OnlineStatus getOnlineStatus(@Nonnull net.dv8tion.jda.api.entities.ClientType type)
      See Also:
      • Member.getOnlineStatus(ClientType)
    • getActiveClients

      @Nonnull public Set<net.dv8tion.jda.api.entities.ClientType> getActiveClients()
      See Also:
      • Member.getActiveClients()
    • getNickname

      @Nullable public String getNickname()
      See Also:
      • Member.getNickname()
    • getAvatarId

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

      @Nullable public String getAvatarUrl()
      See Also:
      • Member.getAvatarUrl()
    • getEffectiveAvatarUrl

      @Nonnull public String getEffectiveAvatarUrl()
      See Also:
      • Member.getEffectiveAvatarUrl()
    • getRoles

      @Nonnull public List<net.dv8tion.jda.api.entities.Role> getRoles()
      See Also:
      • Member.getRoles()
    • getColor

      @Nullable public Color getColor()
      See Also:
      • Member.getColor()
    • getColorRaw

      public int getColorRaw()
      See Also:
      • Member.getColorRaw()
    • canInteract

      public boolean canInteract(@Nonnull net.dv8tion.jda.api.entities.Member member)
      See Also:
      • Member.canInteract(Member)
    • canInteract

      public boolean canInteract(@Nonnull YMember member)
      See Also:
      • Member.canInteract(Member)
    • canInteract

      public boolean canInteract(@Nonnull net.dv8tion.jda.api.entities.Emote emote)
      See Also:
      • Member.canInteract(Emote)
    • isOwner

      public boolean isOwner()
      See Also:
      • Member.isOwner()
    • isPending

      @Incubating public boolean isPending()
      See Also:
      • Member.isPending()
    • getDefaultChannel

      @Nullable public net.dv8tion.jda.api.entities.BaseGuildMessageChannel getDefaultChannel()
      See Also:
      • Member.getDefaultChannel()
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(int delDays)
      See Also:
      • Member.ban(int)
    • ban

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> ban(int delDays, @Nullable String reason)
      See Also:
      • Member.ban(int, String)
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick()
      See Also:
      • Member.kick()
    • kick

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> kick(String reason)
      See Also:
      • Member.kick(String)
    • mute

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> mute(boolean mute)
      See Also:
      • Member.mute(boolean)
    • deafen

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> deafen(boolean deafen)
      See Also:
      • Member.deafen(boolean)
    • modifyNickname

      @CheckReturnValue @Nonnull public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> modifyNickname(@Nullable String nickname)
      See Also:
      • Member.modifyNickname(String)
    • getName

      @Nonnull public String getName()
      See Also:
      • ()
    • getAuthor

      public net.dv8tion.jda.api.entities.Member getAuthor()
      See Also:
      • Member
    • getMemberId

      @Nonnull public String getMemberId()
      See Also:
      • ISnowflake.getId()
    • getMemberIdLong

      @Nonnull public Long getMemberIdLong()
      See Also:
      • ISnowflake.getIdLong()
    • getPermissions

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissions()
      See Also:
      • IPermissionHolder.getPermissions()
    • getPermissions

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissions(@Nonnull net.dv8tion.jda.api.entities.GuildChannel channel)
      See Also:
      • IPermissionHolder.getPermissions(GuildChannel)
    • getPermissions

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissions(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel)
    • getPermissionsExplicit

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissionsExplicit()
      See Also:
      • IPermissionHolder.getPermissionsExplicit()
    • getPermissionsExplicit

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissionsExplicit(@Nonnull net.dv8tion.jda.api.entities.GuildChannel channel)
      See Also:
      • IPermissionHolder.getPermissionsExplicit(GuildChannel)
    • getPermissionsExplicit

      @Nonnull public Set<net.dv8tion.jda.api.Permission> getPermissionsExplicit(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.Permission... permissions)
      See Also:
      • IPermissionHolder.hasPermission(Permission...)
    • hasPermission

      public boolean hasPermission(@Nonnull Collection<net.dv8tion.jda.api.Permission> permissions)
      See Also:
      • IPermissionHolder.hasPermission(Collection)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.entities.GuildChannel channel, @Nonnull net.dv8tion.jda.api.Permission... permissions)
      See Also:
      • IPermissionHolder.hasPermission(GuildChannel, Permission...)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.entities.GuildChannel channel, @Nonnull Collection<net.dv8tion.jda.api.Permission> permissions)
      See Also:
      • IPermissionHolder.hasPermission(GuildChannel, Collection)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel, @Nonnull net.dv8tion.jda.api.Permission... permissions)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel, @Nonnull Collection<net.dv8tion.jda.api.Permission> permissions)
    • hasAccess

      public boolean hasAccess(@Nonnull net.dv8tion.jda.api.entities.GuildChannel channel)
      See Also:
      • IPermissionHolder.hasAccess(GuildChannel)
    • canSync

      public boolean canSync(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer targetChannel, @Nonnull net.dv8tion.jda.api.entities.IPermissionContainer syncSource)
    • canSync

      public boolean canSync(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel)
    • hasAccess

      public boolean hasAccess(@Nonnull net.dv8tion.jda.api.entities.IPermissionContainer channel)
    • hasPermission

      public boolean hasPermission(@Nonnull net.dv8tion.jda.api.Permission permission)
      See Also:
      • IPermissionHolder.hasPermission(Permission...)
    • getTimeOutEnd

      @Nullable public OffsetDateTime getTimeOutEnd()
      The time this Member will be released from time out.
      If this Member is not in time out, this returns null. This may also return dates in the past, in which case the time out has expired.
      Returns:
      The time this Member will be released from time out or null if not in time out
    • isTimedOut

      public boolean isTimedOut()
      Whether this Member is in time out.
      While a Member is in time out, all permissions except VIEW_CHANNEL and MESSAGE_HISTORY are removed from them.
      Returns:
      True, if this Member is in time out
    • timeoutFor

      @Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(long amount, @Nonnull TimeUnit unit)
      Puts this Member in time out in this Guild for a specific amount of time.
      While a Member is in time out, all permissions except VIEW_CHANNEL and MESSAGE_HISTORY are removed from them.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be put into time out due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      amount - The amount of the provided unit to put this Member in time out for
      unit - The Unit type of amount
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
      IllegalArgumentException - If any of the following checks are true
      • The provided amount is lower than or equal to 0
      • The provided unit is null
      • The provided amount with the unit results in a date that is more than 28 days in the future
    • timeoutFor

      @Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull Duration duration)
      Puts this Member in time out in this Guild for a specific amount of time.
      While a Member is in time out, all permissions except VIEW_CHANNEL and MESSAGE_HISTORY are removed from them.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be put into time out due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      duration - The duration to put this Member in time out for
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
      IllegalArgumentException - If any of the following checks are true
      • The provided duration is null
      • The provided duration is not positive
      • The provided duration results in a date that is more than 28 days in the future
    • timeoutUntil

      @Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutUntil(@Nullable TemporalAccessor temporal)
      Puts this Member in time out in this Guild until the specified date.
      While a Member is in time out, all permissions except VIEW_CHANNEL and MESSAGE_HISTORY are removed from them.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The target Member cannot be put into time out due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Parameters:
      temporal - The time this Member will be released from time out, or null to remove the time out
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
      IllegalArgumentException - If any of the following checks are true
      • The provided temporal is in the past
      • The provided temporal is more than 28 days in the future
    • removeTimeout

      @Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeout()
      Removes a time out from this Member in this Guild.

      Possible ErrorResponses caused by the returned RestAction include the following:

      • MISSING_PERMISSIONS
        The time out cannot be removed due to a permission discrepancy
      • UNKNOWN_MEMBER
        The specified Member was removed from the Guild before finishing the task
      Returns:
      AuditableRestAction
      Throws:
      net.dv8tion.jda.api.exceptions.InsufficientPermissionException - If the logged in account does not have the Permission.MODERATE_MEMBERS permission.
    • getAsMention

      @Nonnull public String getAsMention()
    • getIdLong

      public long getIdLong()
    • isDeafened

      public boolean isDeafened()
    • getTimeCreated

      @NotNull public @NotNull OffsetDateTime getTimeCreated()
    • getAudioManager

      @NotNull public @NotNull net.dv8tion.jda.api.managers.AudioManager getAudioManager()
    • isInVc

      public boolean isInVc()
    • joinVc

      public void joinVc(@NotNull @NotNull YReplyCallback callback)
    • leaveVc

      public void leaveVc(@NotNull @NotNull YReplyCallback callback)
    • joinVc

      public void joinVc(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • leaveVc

      public void leaveVc(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • joinVc

      public void joinVc(@NotNull @NotNull YMember member, @NotNull @NotNull YReplyCallback callback)
    • leaveVc

      public void leaveVc(@NotNull @NotNull YMember member, @NotNull @NotNull YReplyCallback callback)
    • joinVc

      public void joinVc(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • leaveVc

      public void leaveVc(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • deafen

      public void deafen(@NotNull @NotNull YReplyCallback callback)
    • deafen

      public void deafen(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • deafen

      public void deafen(@NotNull @NotNull YMember member, @NotNull @NotNull YReplyCallback callback)
    • deafen

      public void deafen(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • mute

      public void mute(@NotNull @NotNull YReplyCallback callback)
    • mute

      public void mute(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • mute

      public void mute(@NotNull @NotNull YMember member, @NotNull @NotNull YReplyCallback callback)
    • mute

      public void mute(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback)
    • 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.
    • member

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