Interface InteractionMember
- All Known Implementing Classes:
InteractionMemberImpl
public interface InteractionMember
Represents the interaction command executor as a guild member.
-
Method Summary
Modifier and TypeMethodDescriptionGets the discord mention of this member.Gets the four numbers after the#
in the member's username.Gets the nickname of this member or their username if they don't have one.getId()
Gets the ID of this member.getName()
Gets the username of this member.Gets the nickname of this member or null if they do not have one.default String
getTag()
Gets this member's name and discriminator split by a#
.boolean
Returns true if the user has a role by the specified ID.boolean
hasRole
(InteractionRole role) Returns true if the user has the specifiedrole
.boolean
Returns true if the user has one of the specified roles.boolean
isAdmin()
Checks if this member has the administrator permission on Discord.sendPrivateMessage
(String content) Sends a private message to this member with the given content.
-
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
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
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
Returns true if the user has the specifiedrole
.- Parameters:
role
- The role to check for.- Returns:
- true if the member has the specified role.
-
hasRole
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
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.
-