Package com.mewna.catnip.entity.guild
Interface Member
- All Superinterfaces:
Entity
,GuildEntity
,HasGuild
,HasJoinedAt
,Mentionable
,Permissable
,Snowflake
,Timestamped
- All Known Subinterfaces:
InteractionMember
- All Known Implementing Classes:
InteractionMemberImpl
,MemberImpl
A member in a guild.
- Since:
- 9/4/18.
- Author:
- amy
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.reactivex.rxjava3.core.Completable
default io.reactivex.rxjava3.core.Completable
default io.reactivex.rxjava3.core.Completable
default io.reactivex.rxjava3.core.Completable
default String
default String
avatarUrl
(ImageOptions options) default boolean
canInteract
(Member member) Checks whether the entity can interact with a member or not.default boolean
canInteract
(Role role) Checks whether the entity can interact with a role or not.default Color
color()
The member's color, as shown in the official Discord Client, ornull
if they have no roles with a color.default io.reactivex.rxjava3.core.Single<DMChannel>
createDM()
Creates a DM channel with this member's user.default io.reactivex.rxjava3.core.Single<Boolean>
deaf()
Whether the user is deafened.default io.reactivex.rxjava3.core.Single<String>
The user's effective name show in this guild.default boolean
hasPermissions
(GuildChannel channel, Collection<Permission> permissions) Checks whether the entity has the permissions or not in a specificGuildChannel
.default boolean
hasPermissions
(Collection<Permission> permissions) Checks whether the entity has the permissions or not.default io.reactivex.rxjava3.core.Single<Boolean>
isOwner()
Checks if the member is the owner of the guild.joinedAt()
When the user joined the server last.default io.reactivex.rxjava3.core.Single<Boolean>
mute()
Whether the user is voice muted.nick()
The user's nickname in this guild.The member's roles in the guild, sorted from lowest to highest.orderedRoles
(Comparator<Role> comparator) default Set<Permission>
Returns a list of the entity's permissions.default Set<Permission>
permissions
(GuildChannel channel) When the user last used their Nitro Boost on this guild.default io.reactivex.rxjava3.core.Completable
removeRole
(Role role, Member member) default io.reactivex.rxjava3.core.Completable
removeRole
(Role role, Member member, String reason) default io.reactivex.rxjava3.core.Completable
removeRole
(String roleId, String memberId) default io.reactivex.rxjava3.core.Completable
removeRole
(String roleId, String memberId, String reason) roleIds()
The ids of the user's roles in this guild.roles()
The member's roles in the guild.default io.reactivex.rxjava3.core.Maybe<User>
user()
The user equivalent to this member.default io.reactivex.rxjava3.core.Maybe<VoiceState>
Methods inherited from interface com.mewna.catnip.entity.partials.GuildEntity
guild
Methods inherited from interface com.mewna.catnip.entity.partials.HasGuild
guildId, guildIdAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Permissable
hasPermissions, hasPermissions, permissionsRaw
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
user
The user equivalent to this member. -
nick
The user's nickname in this guild.- Returns:
- User's nickname. Null if not set.
-
effectiveName
The user's effective name show in this guild.- Returns:
- User's nickname, if set, otherwise the username.
-
roleIds
The ids of the user's roles in this guild.- Returns:
- A
Set
of the ids of the user's roles.
-
roles
The member's roles in the guild.- Returns:
- A
Set
of the member's roles.
-
orderedRoles
The member's roles in the guild, sorted from lowest to highest.- Returns:
- A
List
of the member's roles.
-
orderedRoles
-
mute
Whether the user is voice muted.
Voice muted user cannot transmit voice.- Returns:
- True if muted, false otherwise.
-
deaf
Whether the user is deafened.
Deafened users cannot receive nor send voice.- Returns:
- True if deafened, false otherwise.
-
voiceState
- Returns:
- The user's voice state in this guild. May be null.
-
joinedAt
When the user joined the server last.
Members who have joined, left, then rejoined will only have the most recent join exposed.
This may be null under some conditions, ex. a member leaving a guild. In cases like this, catnip will attempt to load the old data from the cache if possible, but it may not work, hence nullability.- Specified by:
joinedAt
in interfaceHasJoinedAt
- Returns:
- The
date and time
the member joined the guild.
-
avatarHash
- Returns:
- The hash of the user's per-guild avatar.
-
avatarUrl
-
color
The member's color, as shown in the official Discord Client, ornull
if they have no roles with a color.
This will iterate over all the roles this member has, so try to avoid calling this method multiple times if you only need the value once.- Returns:
- A
color
representing the member's color, as shown in the official Discord Client.
-
createDM
Creates a DM channel with this member's user.- Returns:
- Future with the result of the DM creation.
-
permissions
Description copied from interface:Permissable
Returns a list of the entity's permissions.- Specified by:
permissions
in interfacePermissable
- Returns:
- a list of the entity's permissions
-
permissions
-
hasPermissions
Description copied from interface:Permissable
Checks whether the entity has the permissions or not.- Specified by:
hasPermissions
in interfacePermissable
- Parameters:
permissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
hasPermissions
default boolean hasPermissions(@Nonnull GuildChannel channel, @Nonnull Collection<Permission> permissions) Description copied from interface:Permissable
Checks whether the entity has the permissions or not in a specificGuildChannel
.- Specified by:
hasPermissions
in interfacePermissable
- Parameters:
channel
- The channel in which the entity should have the permissionpermissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
canInteract
Description copied from interface:Permissable
Checks whether the entity can interact with a role or not.- Specified by:
canInteract
in interfacePermissable
- Parameters:
role
- The role the entity should interact with.- Returns:
- Whether the entity can interact with a role or not
-
canInteract
Description copied from interface:Permissable
Checks whether the entity can interact with a member or not.- Specified by:
canInteract
in interfacePermissable
- Parameters:
member
- The member the entity should interact with.- Returns:
- Whether the entity can interact with a member or not
-
isOwner
Checks if the member is the owner of the guild.- Returns:
- Whether the member owns the guild or not
-
asMention
- Specified by:
asMention
in interfaceMentionable
- Returns:
- A mention for this member that can be sent in a message.
-
addRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRole(@Nonnull Role role, @Nonnull Member target) - Parameters:
role
- The role to add.target
- The member to add the role to.- Returns:
- A
Completable
that completes when the role is added.
-
addRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRole(@Nonnull String roleId, @Nonnull String memberId) - Parameters:
roleId
- The id of the role to add.memberId
- The id of the member to add the role to.- Returns:
- A
Completable
that completes when the role is added.
-
addRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRole(@Nonnull Role role, @Nonnull Member target, @Nullable String reason) - Parameters:
role
- The role to add.target
- The member to add the role to.reason
- The reason for adding the role.- Returns:
- A
Completable
that completes when the role is added.
-
addRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable addRole(@Nonnull String roleId, @Nonnull String memberId, @Nullable String reason) - Parameters:
roleId
- The id of the role to add.memberId
- The id of the member to add the role to.reason
- The reason for adding the role.- Returns:
- A
Completable
that completes when the role is added.
-
removeRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRole(@Nonnull Role role, @Nonnull Member member) - Parameters:
role
- The role to remove.member
- The member to remove from.- Returns:
- A
Completable
that completes when the role is removed.
-
removeRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRole(@Nonnull String roleId, @Nonnull String memberId) - Parameters:
roleId
- The id of the role to remove.memberId
- The id of the member to remove from.- Returns:
- A
Completable
that completes when the role is removed.
-
removeRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRole(@Nonnull Role role, @Nonnull Member member, @Nullable String reason) - Parameters:
role
- The role to remove.member
- The member to remove from.reason
- The reason for removing the role.- Returns:
- A
Completable
that completes when the role is removed.
-
removeRole
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable removeRole(@Nonnull String roleId, @Nonnull String memberId, @Nullable String reason) - Parameters:
roleId
- The id of the role to remove.memberId
- The id of the member to remove from.reason
- The reason for removing the role.- Returns:
- A
Completable
that completes when the role is removed.
-