public final class Member extends User
Constructor and Description |
---|
Member(ServiceMediator serviceMediator,
MemberBean data,
UserBean userData,
long guildId)
Constructs a
Member with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Void> |
addRole(Snowflake roleId)
Requests to add a role to this member.
|
reactor.core.publisher.Mono<Void> |
addRole(Snowflake roleId,
String reason)
Requests to add a role to this member while optionally specifying the reason.
|
reactor.core.publisher.Mono<Member> |
asMember(Snowflake guildId)
Requests to retrieve this user as a
Member . |
reactor.core.publisher.Mono<Void> |
ban(Consumer<? super BanQuerySpec> spec)
Requests to ban this user.
|
reactor.core.publisher.Mono<Void> |
edit(Consumer<? super GuildMemberEditSpec> spec)
Requests to edit this member.
|
reactor.core.publisher.Mono<PermissionSet> |
getBasePermissions()
Requests to calculate the permissions granted to this member by his roles in the guild.
|
String |
getDisplayName()
Gets the name that is displayed in client.
|
reactor.core.publisher.Mono<Guild> |
getGuild()
Requests to retrieve the guild this user is associated to.
|
Snowflake |
getGuildId()
Gets the ID of the guild this user is associated to.
|
Instant |
getJoinTime()
Gets when the user joined the guild.
|
Optional<String> |
getNickname()
Gets the user's guild nickname (if one is set).
|
String |
getNicknameMention()
Gets the raw nickname mention.
|
reactor.core.publisher.Mono<Presence> |
getPresence()
Requests to retrieve the presence for this user for this guild.
|
Set<Snowflake> |
getRoleIds()
Gets the user's guild roles' IDs.
|
reactor.core.publisher.Flux<Role> |
getRoles()
Requests to retrieve the user's guild roles.
|
reactor.core.publisher.Mono<VoiceState> |
getVoiceState()
Requests to retrieve this user's voice state for this guild.
|
reactor.core.publisher.Mono<Void> |
kick()
Requests to kick this member.
|
reactor.core.publisher.Mono<Void> |
kick(String reason)
Requests to kick this member while optionally specifying the reason.
|
reactor.core.publisher.Mono<Void> |
removeRole(Snowflake roleId)
Requests to remove a role from this member.
|
reactor.core.publisher.Mono<Void> |
removeRole(Snowflake roleId,
String reason)
Requests to remove a role from this member while optionally specifying the reason.
|
String |
toString() |
reactor.core.publisher.Mono<Void> |
unban()
Requests to unban this user.
|
reactor.core.publisher.Mono<Void> |
unban(String reason)
Requests to unban this user while optionally specifying the reason.
|
equals, getAvatarUrl, getAvatarUrl, getClient, getDefaultAvatarUrl, getDiscriminator, getId, getMention, getPrivateChannel, getUsername, hasAnimatedAvatar, hashCode, isBot
public Member(ServiceMediator serviceMediator, MemberBean data, UserBean userData, long guildId)
Member
with an associated ServiceMediator and Discord data.serviceMediator
- The ServiceMediator associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.userData
- The user data as represented by Discord, must be non-null.guildId
- The ID of the guild this user is associated to.public reactor.core.publisher.Mono<Member> asMember(Snowflake guildId)
User
Member
.public Set<Snowflake> getRoleIds()
public reactor.core.publisher.Flux<Role> getRoles()
The returned Flux
will emit items in order based off their natural position, which is indicated
visually in the Discord client. For roles, the "lowest" role will be emitted first.
Flux
that continually emits the user's guild roles
. If an error is received, it is
emitted through the Flux
.public Instant getJoinTime()
public Snowflake getGuildId()
public reactor.core.publisher.Mono<Guild> getGuild()
Mono
where, upon successful completion, emits the guild
this user is associated
to. If an error is received, it is emitted through the Mono
.public String getDisplayName()
public Optional<String> getNickname()
public String getNicknameMention()
public reactor.core.publisher.Mono<VoiceState> getVoiceState()
Mono
where, upon successful completion, emits a voice state
for this user
for this guild. If an error is received, it is emitted through the Mono
.store
does not save
VoiceStateBean
instances OR the bot is currently not logged in then the returned Mono
will
always be empty.public reactor.core.publisher.Mono<Presence> getPresence()
Mono
where, upon successful completion, emits a presence
for this user for
this guild. If an error is received, it is emitted through the Mono
.store
does not save
PresenceBean
instances OR the bot is currently not logged in then the returned Mono
will
always be empty.public reactor.core.publisher.Mono<Void> kick()
Mono
where, upon successful completion, emits nothing; indicating the member was kicked. If an
error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> kick(@Nullable String reason)
reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the member was kicked. If an
error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> ban(Consumer<? super BanQuerySpec> spec)
spec
- A Consumer
that provides a "blank" BanQuerySpec
to be operated on.Mono
where, upon successful completion, emits nothing; indicating this user was banned. If an
error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> unban()
Mono
where, upon successful completion, emits nothing; indicating this user was unbanned. If an
error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> unban(@Nullable String reason)
reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating this user was unbanned. If an
error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> addRole(Snowflake roleId)
roleId
- The ID of the role to add to this member.Mono
where, upon successful completion, emits nothing; indicating the role was added to this
member. If an error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> addRole(Snowflake roleId, @Nullable String reason)
roleId
- The ID of the role to add to this member.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the role was added to this
member. If an error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> removeRole(Snowflake roleId)
roleId
- The ID of the role to remove from this member.Mono
where, upon successful completion, emits nothing; indicating the role was removed from
this member. If an error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<Void> removeRole(Snowflake roleId, @Nullable String reason)
roleId
- The ID of the role to remove from this member.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the role was removed from
this member. If an error is received, it is emitted through the Mono
.public reactor.core.publisher.Mono<PermissionSet> getBasePermissions()
public reactor.core.publisher.Mono<Void> edit(Consumer<? super GuildMemberEditSpec> spec)
spec
- A Consumer
that provides a "blank" GuildMemberEditSpec
to be operated on.Mono
where, upon successful completion, emits nothing; indicating the member has been edited.
If an error is received, it is emitted through the Mono
.