Record Class YMember
java.lang.Object
java.lang.Record
io.github.yusufsdiscordbot.yusufsdiscordcore.bot.core.YMember
Represents a Guild-specific User.
Contains all guild-specific information about a User. (Roles, Nickname, VoiceStatus etc.)
- Since:
- 3.0
- See Also:
-
YGuild.getMember(User)YGuild.getMemberCache()YGuild.getMemberById(long)YGuild.getMemberByTag(String)YGuild.getMemberByTag(String, String)YGuild.getMembersByEffectiveName(String, boolean)YGuild.getMembersByName(String, boolean)YGuild.getMembersByNickname(String, boolean)YGuild.getMembersWithRoles(Role...)YGuild.getMembers()
-
Constructor Summary
ConstructorsConstructorDescriptionYMember(net.dv8tion.jda.api.entities.Member member) Creates an instance of aYMemberrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>ban(int delDays) net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>booleancanInteract(YMember member) booleancanInteract(net.dv8tion.jda.api.entities.Emote emote) booleancanInteract(net.dv8tion.jda.api.entities.Member member) booleancanInteract(net.dv8tion.jda.api.entities.Role role) booleancanSync(net.dv8tion.jda.api.entities.IPermissionContainer channel) booleancanSync(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) voiddeafen(@NotNull YMember member, @NotNull YReplyCallback callback) voiddeafen(@NotNull YReplyCallback callback) voiddeafen(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) voiddeafen(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) final booleanIndicates 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.AudioManagernet.dv8tion.jda.api.entities.Member@Nullable StringgetColor()intnet.dv8tion.jda.api.entities.BaseGuildMessageChannelgetGuild()long@NotNull net.dv8tion.jda.api.JDAgetJDA()The JDA instance.getName()net.dv8tion.jda.api.OnlineStatusnet.dv8tion.jda.api.OnlineStatusgetOnlineStatus(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>getRoles()@NotNull OffsetDateTimeThe time this Member will be released from time out.getUser()net.dv8tion.jda.api.entities.GuildVoiceStatebooleanhasAccess(net.dv8tion.jda.api.entities.GuildChannel channel) booleanhasAccess(net.dv8tion.jda.api.entities.IPermissionContainer channel) final inthashCode()Returns a hash code value for this object.booleanhasPermission(Collection<net.dv8tion.jda.api.Permission> permissions) booleanhasPermission(net.dv8tion.jda.api.entities.GuildChannel channel, Collection<net.dv8tion.jda.api.Permission> permissions) booleanhasPermission(net.dv8tion.jda.api.entities.GuildChannel channel, net.dv8tion.jda.api.Permission... permissions) booleanhasPermission(net.dv8tion.jda.api.entities.IPermissionContainer channel, Collection<net.dv8tion.jda.api.Permission> permissions) booleanhasPermission(net.dv8tion.jda.api.entities.IPermissionContainer channel, net.dv8tion.jda.api.Permission... permissions) booleanhasPermission(net.dv8tion.jda.api.Permission permission) booleanhasPermission(net.dv8tion.jda.api.Permission... permissions) booleanbooleanReturns whether a member is boosting the guild or not.booleanbooleanisInVc()booleanisOwner()booleanbooleanWhether this Member is in time out.voidjoinVc(@NotNull YMember member, @NotNull YReplyCallback callback) voidjoinVc(@NotNull YReplyCallback callback) voidjoinVc(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) voidjoinVc(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>kick()net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>voidleaveVc(@NotNull YMember member, @NotNull YReplyCallback callback) voidleaveVc(@NotNull YReplyCallback callback) voidleaveVc(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) voidleaveVc(@NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) net.dv8tion.jda.api.entities.Membermember()Returns the value of thememberrecord component.net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>modifyNickname(String nickname) net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>mute(boolean mute) voidmute(@NotNull YMember member, @NotNull YReplyCallback callback) voidmute(@NotNull YReplyCallback callback) voidmute(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) voidmute(@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 thisGuild.net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>timeoutFor(long amount, TimeUnit unit) Puts this Member in time out in thisGuildfor a specific amount of time.net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>timeoutFor(Duration duration) Puts this Member in time out in thisGuildfor a specific amount of time.net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void>timeoutUntil(TemporalAccessor temporal) Puts this Member in time out in thisGuilduntil the specified date.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
YMember
public YMember(net.dv8tion.jda.api.entities.Member member) Creates an instance of aYMemberrecord class.- Parameters:
member- the value for thememberrecord component
-
-
Method Details
-
getUser
-
canInteract
public boolean canInteract(@Nonnull net.dv8tion.jda.api.entities.Role role) - See Also:
-
Member.canInteract(Role)
-
getGuild
- See Also:
-
Member.getGuild()
-
getJDA
@NotNull public @NotNull net.dv8tion.jda.api.JDA getJDA()The JDA instance.- Returns:
- The current JDA instance.
-
getTimeJoined
- See Also:
-
Member.getTimeJoined()
-
hasTimeJoined
public boolean hasTimeJoined()- See Also:
-
Member.hasTimeJoined()
-
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
- 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
- See Also:
-
Member.getActiveClients()
-
getNickname
- See Also:
-
Member.getNickname()
-
getAvatarId
- See Also:
-
Member.getAvatarId()
-
getAvatarUrl
- See Also:
-
Member.getAvatarUrl()
-
getEffectiveAvatarUrl
- See Also:
-
Member.getEffectiveAvatarUrl()
-
getRoles
- See Also:
-
Member.getRoles()
-
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
- 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
- See Also:
-
()
-
getAuthor
public net.dv8tion.jda.api.entities.Member getAuthor()- See Also:
-
Member
-
getMemberId
- See Also:
-
ISnowflake.getId()
-
getMemberIdLong
- See Also:
-
ISnowflake.getIdLong()
-
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
- 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
- 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
The time this Member will be released from time out.
If this Member is not in time out, this returnsnull. 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
nullif not in time out
-
isTimedOut
public boolean isTimedOut()Whether this Member is in time out.
While a Member is in time out, all permissions exceptVIEW_CHANNELandMESSAGE_HISTORYare 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 thisGuildfor a specific amount of time.
While a Member is in time out, all permissions exceptVIEW_CHANNELandMESSAGE_HISTORYare removed from them.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The target Member cannot be put into time out due to a permission discrepancyUNKNOWN_MEMBER
The specified Member was removed from the Guild before finishing the task
- Parameters:
amount- The amount of the providedunitto put this Member in time out forunit- TheUnittype ofamount- Returns:
AuditableRestAction- Throws:
net.dv8tion.jda.api.exceptions.InsufficientPermissionException- If the logged in account does not have thePermission.MODERATE_MEMBERSpermission.IllegalArgumentException- If any of the following checks are true- The provided
amountis lower than or equal to0 - The provided
unitis null - The provided
amountwith theunitresults in a date that is more than 28 days in the future
- The provided
-
timeoutFor
@Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutFor(@Nonnull Duration duration) Puts this Member in time out in thisGuildfor a specific amount of time.
While a Member is in time out, all permissions exceptVIEW_CHANNELandMESSAGE_HISTORYare removed from them.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The target Member cannot be put into time out due to a permission discrepancyUNKNOWN_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 thePermission.MODERATE_MEMBERSpermission.IllegalArgumentException- If any of the following checks are true- The provided
durationis null - The provided
durationis not positive - The provided
durationresults in a date that is more than 28 days in the future
- The provided
-
timeoutUntil
@Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> timeoutUntil(@Nullable TemporalAccessor temporal) Puts this Member in time out in thisGuilduntil the specified date.
While a Member is in time out, all permissions exceptVIEW_CHANNELandMESSAGE_HISTORYare removed from them.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The target Member cannot be put into time out due to a permission discrepancyUNKNOWN_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 thePermission.MODERATE_MEMBERSpermission.IllegalArgumentException- If any of the following checks are true- The provided
temporalis in the past - The provided
temporalis more than 28 days in the future
- The provided
-
removeTimeout
@Nonnull @CheckReturnValue public net.dv8tion.jda.api.requests.restaction.AuditableRestAction<Void> removeTimeout()Removes a time out from this Member in thisGuild.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The time out cannot be removed due to a permission discrepancyUNKNOWN_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 thePermission.MODERATE_MEMBERSpermission.
-
getAsMention
-
getIdLong
public long getIdLong() -
isDeafened
public boolean isDeafened() -
getTimeCreated
-
getAudioManager
@NotNull public @NotNull net.dv8tion.jda.api.managers.AudioManager getAudioManager() -
isInVc
public boolean isInVc() -
joinVc
-
leaveVc
-
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
-
leaveVc
-
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
-
deafen
public void deafen(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) -
deafen
-
deafen
public void deafen(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) -
mute
-
mute
public void mute(@NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) -
mute
-
mute
public void mute(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull net.dv8tion.jda.api.interactions.callbacks.IReplyCallback callback) -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
member
public net.dv8tion.jda.api.entities.Member member()Returns the value of thememberrecord component.- Returns:
- the value of the
memberrecord component
-