Interface Member

All Superinterfaces:
Entity, GuildEntity, HasGuild, HasJoinedAt, Mentionable, Permissable, Snowflake, Timestamped
All Known Subinterfaces:
InteractionMember
All Known Implementing Classes:
InteractionMemberImpl, MemberImpl

public interface Member extends Mentionable, Permissable, HasJoinedAt
A member in a guild.
Since:
9/4/18.
Author:
amy
  • Method Details

    • user

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<User> user()
      The user equivalent to this member.
    • nick

      @Nullable @CheckReturnValue String nick()
      The user's nickname in this guild.
      Returns:
      User's nickname. Null if not set.
    • effectiveName

      @Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Single<String> effectiveName()
      The user's effective name show in this guild.
      Returns:
      User's nickname, if set, otherwise the username.
    • roleIds

      @Nonnull @CheckReturnValue Set<String> roleIds()
      The ids of the user's roles in this guild.
      Returns:
      A Set of the ids of the user's roles.
    • roles

      @Nonnull @CheckReturnValue default Set<Role> roles()
      The member's roles in the guild.
      Returns:
      A Set of the member's roles.
    • orderedRoles

      @Nonnull @CheckReturnValue default List<Role> orderedRoles()
      The member's roles in the guild, sorted from lowest to highest.
      Returns:
      A List of the member's roles.
    • orderedRoles

      @Nonnull @CheckReturnValue default List<Role> orderedRoles(Comparator<Role> comparator)
    • mute

      @CheckReturnValue default io.reactivex.rxjava3.core.Single<Boolean> mute()
      Whether the user is voice muted.
      Voice muted user cannot transmit voice.
      Returns:
      True if muted, false otherwise.
    • deaf

      @CheckReturnValue default io.reactivex.rxjava3.core.Single<Boolean> deaf()
      Whether the user is deafened.
      Deafened users cannot receive nor send voice.
      Returns:
      True if deafened, false otherwise.
    • voiceState

      @CheckReturnValue default io.reactivex.rxjava3.core.Maybe<VoiceState> voiceState()
      Returns:
      The user's voice state in this guild. May be null.
    • joinedAt

      @Nullable @CheckReturnValue OffsetDateTime 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 interface HasJoinedAt
      Returns:
      The date and time the member joined the guild.
    • premiumSince

      @Nullable @CheckReturnValue OffsetDateTime premiumSince()
      When the user last used their Nitro Boost on this guild.
      Members who have un-boosted a guild then re-boosted it will only have the most recent boost exposed.
      This will be null if the user is not currently boosting the guild.
      Returns:
      The date and time when the member boosted the guild.
    • avatarHash

      @Nullable @CheckReturnValue String avatarHash()
      Returns:
      The hash of the user's per-guild avatar.
    • avatarUrl

      @Nullable @CheckReturnValue default String avatarUrl(@Nonnull ImageOptions options)
    • color

      @Nullable @CheckReturnValue default Color color()
      The member's color, as shown in the official Discord Client, or null 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

      @CheckReturnValue default io.reactivex.rxjava3.core.Single<DMChannel> createDM()
      Creates a DM channel with this member's user.
      Returns:
      Future with the result of the DM creation.
    • permissions

      default Set<Permission> permissions()
      Description copied from interface: Permissable
      Returns a list of the entity's permissions.
      Specified by:
      permissions in interface Permissable
      Returns:
      a list of the entity's permissions
    • permissions

      default Set<Permission> permissions(@Nonnull GuildChannel channel)
    • hasPermissions

      default boolean hasPermissions(@Nonnull Collection<Permission> permissions)
      Description copied from interface: Permissable
      Checks whether the entity has the permissions or not.
      Specified by:
      hasPermissions in interface Permissable
      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 specific GuildChannel.
      Specified by:
      hasPermissions in interface Permissable
      Parameters:
      channel - The channel in which the entity should have the permission
      permissions - The permissions to check.
      Returns:
      Whether the entity has the permissions or not
    • canInteract

      default boolean canInteract(@Nonnull Role role)
      Description copied from interface: Permissable
      Checks whether the entity can interact with a role or not.
      Specified by:
      canInteract in interface Permissable
      Parameters:
      role - The role the entity should interact with.
      Returns:
      Whether the entity can interact with a role or not
    • canInteract

      default boolean canInteract(@Nonnull Member member)
      Description copied from interface: Permissable
      Checks whether the entity can interact with a member or not.
      Specified by:
      canInteract in interface Permissable
      Parameters:
      member - The member the entity should interact with.
      Returns:
      Whether the entity can interact with a member or not
    • isOwner

      default io.reactivex.rxjava3.core.Single<Boolean> isOwner()
      Checks if the member is the owner of the guild.
      Returns:
      Whether the member owns the guild or not
    • asMention

      @Nonnull @CheckReturnValue default String asMention()
      Specified by:
      asMention in interface Mentionable
      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.