Interface InteractionMember

All Known Implementing Classes:
InteractionMemberImpl

public interface InteractionMember
Represents the interaction command executor as a guild member.
  • Method Details

    • getName

      String getName()
      Gets the username of this member.
      Returns:
      this member's username.
    • getDiscriminator

      String getDiscriminator()
      Gets the four numbers after the # in the member's username.
      Returns:
      this member's discriminator.
    • getTag

      default String getTag()
      Gets this member's name and discriminator split by a #.
      Returns:
      this member's tag.
    • getAsMention

      String getAsMention()
      Gets the discord mention of this member.
      Returns:
      this member's mention.
    • getEffectiveName

      String getEffectiveName()
      Gets the nickname of this member or their username if they don't have one.
      Returns:
      this member's nickname or username if none is present.
    • getNickname

      String getNickname()
      Gets the nickname of this member or null if they do not have one.
      Returns:
      this member's nickname or null.
    • getId

      String getId()
      Gets the ID of this member.
      Returns:
      this member's ID.
    • isAdmin

      boolean isAdmin()
      Checks if this member has the administrator permission on Discord.
      Returns:
      true if this user has administrative permissions.
    • hasRoles

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

      boolean hasRole(InteractionRole role)
      Returns true if the user has the specified role.
      Parameters:
      role - The role to check for.
      Returns:
      true if the member has the specified role.
    • hasRole

      boolean hasRole(String roleId)
      Returns true if the user has a role by the specified ID.
      Parameters:
      roleId - The role id to check for.
      Returns:
      true if the member has a role by the specified ID.
    • sendPrivateMessage

      CompletableFuture<Boolean> sendPrivateMessage(String content)
      Sends a private message to this member with the given content.
      Parameters:
      content - The message to send.
      Returns:
      A future which will complete a boolean stating the success of the message.