Class InteractionMemberImpl

java.lang.Object
net.essentialsx.discord.interactions.InteractionMemberImpl
All Implemented Interfaces:
InteractionMember

public class InteractionMemberImpl extends Object implements InteractionMember
  • Constructor Details

    • InteractionMemberImpl

      public InteractionMemberImpl(net.dv8tion.jda.api.entities.Member member)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: InteractionMember
      Gets the username of this member.
      Specified by:
      getName in interface InteractionMember
      Returns:
      this member's username.
    • getDiscriminator

      public String getDiscriminator()
      Description copied from interface: InteractionMember
      Gets the four numbers after the # in the member's username.
      Specified by:
      getDiscriminator in interface InteractionMember
      Returns:
      this member's discriminator.
    • getAsMention

      public String getAsMention()
      Description copied from interface: InteractionMember
      Gets the discord mention of this member.
      Specified by:
      getAsMention in interface InteractionMember
      Returns:
      this member's mention.
    • getEffectiveName

      public String getEffectiveName()
      Description copied from interface: InteractionMember
      Gets the nickname of this member or their username if they don't have one.
      Specified by:
      getEffectiveName in interface InteractionMember
      Returns:
      this member's nickname or username if none is present.
    • getNickname

      public String getNickname()
      Description copied from interface: InteractionMember
      Gets the nickname of this member or null if they do not have one.
      Specified by:
      getNickname in interface InteractionMember
      Returns:
      this member's nickname or null.
    • getId

      public String getId()
      Description copied from interface: InteractionMember
      Gets the ID of this member.
      Specified by:
      getId in interface InteractionMember
      Returns:
      this member's ID.
    • isAdmin

      public boolean isAdmin()
      Description copied from interface: InteractionMember
      Checks if this member has the administrator permission on Discord.
      Specified by:
      isAdmin in interface InteractionMember
      Returns:
      true if this user has administrative permissions.
    • hasRoles

      public boolean hasRoles(List<String> roleDefinitions)
      Description copied from interface: InteractionMember
      Returns true if the user has one of the specified roles.
      Specified by:
      hasRoles in interface InteractionMember
      Parameters:
      roleDefinitions - A list of role definitions from the config.
      Returns:
      true if the member has one of the given roles.
    • hasRole

      public boolean hasRole(InteractionRole role)
      Description copied from interface: InteractionMember
      Returns true if the user has the specified role.
      Specified by:
      hasRole in interface InteractionMember
      Parameters:
      role - The role to check for.
      Returns:
      true if the member has the specified role.
    • hasRole

      public boolean hasRole(String roleId)
      Description copied from interface: InteractionMember
      Returns true if the user has a role by the specified ID.
      Specified by:
      hasRole in interface InteractionMember
      Parameters:
      roleId - The role id to check for.
      Returns:
      true if the member has a role by the specified ID.
    • getJdaObject

      public net.dv8tion.jda.api.entities.Member getJdaObject()
    • sendPrivateMessage

      public CompletableFuture<Boolean> sendPrivateMessage(String content)
      Description copied from interface: InteractionMember
      Sends a private message to this member with the given content.
      Specified by:
      sendPrivateMessage in interface InteractionMember
      Parameters:
      content - The message to send.
      Returns:
      A future which will complete a boolean stating the success of the message.