Class AllowedMentionsBuilder
- java.lang.Object
-
- org.javacord.api.entity.message.mention.AllowedMentionsBuilder
-
public class AllowedMentionsBuilder extends java.lang.Object
This class is used to create mentions.
-
-
Constructor Summary
Constructors Constructor Description AllowedMentionsBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AllowedMentionsBuilder
addRole(long roleId)
Adds a role to the list which will be mentioned.AllowedMentionsBuilder
addRole(java.lang.String roleId)
Adds a role to the list which will be mentioned.AllowedMentionsBuilder
addRoles(java.util.Collection<java.lang.Long> roleIds)
Adds the roles to the list which will be mentioned.AllowedMentionsBuilder
addUser(long userId)
Adds a user to the list which will be mentioned.AllowedMentionsBuilder
addUser(java.lang.String userId)
Adds a user to the list which will be mentioned.AllowedMentionsBuilder
addUsers(java.util.Collection<java.lang.Long> userIds)
Adds the users to the list which will be mentioned.AllowedMentions
build()
Creates aAllowedMentions
instance with the given values.AllowedMentionsBuilderDelegate
getDelegate()
Gets the delegate used by this mentions builder internally.AllowedMentionsBuilder
removeRole(long roleId)
Removes a role from the list which will be mentioned.AllowedMentionsBuilder
removeRole(java.lang.String roleId)
Removes a role from the list which will be mentioned.AllowedMentionsBuilder
removeRoles(java.util.Collection<java.lang.Long> roleIds)
Removes the roles from the list which will be mentioned.AllowedMentionsBuilder
removeUser(long userId)
Removes a user from the list which will be mentioned.AllowedMentionsBuilder
removeUser(java.lang.String userId)
Removes a user from the list which will be mentioned.AllowedMentionsBuilder
removeUsers(java.util.Collection<java.lang.Long> userIds)
Removes the users from the list which will be mentioned.AllowedMentionsBuilder
setMentionEveryoneAndHere(boolean value)
Mentions @everyone and @here.AllowedMentionsBuilder
setMentionRepliedUser(boolean value)
Mention the replied user if the message is a reply.AllowedMentionsBuilder
setMentionRoles(boolean value)
Mentions all mentioned roles.AllowedMentionsBuilder
setMentionUsers(boolean value)
Mentions all mentioned users.
-
-
-
Method Detail
-
getDelegate
public AllowedMentionsBuilderDelegate getDelegate()
Gets the delegate used by this mentions builder internally.- Returns:
- The delegate used by this mention builder internally.
-
setMentionRoles
public AllowedMentionsBuilder setMentionRoles(boolean value)
Mentions all mentioned roles. This will override any explicit role mentions added viaaddRole(long)
oraddRoles(Collection)
- Parameters:
value
- If roles should be mentioned or not.- Returns:
- The current instance in order to chain call methods.
-
setMentionUsers
public AllowedMentionsBuilder setMentionUsers(boolean value)
Mentions all mentioned users. This will override any explicit user mentions added viaaddUser(long)
oraddUsers(Collection)
- Parameters:
value
- If users should be mentioned or not.- Returns:
- The current instance in order to chain call methods.
-
setMentionEveryoneAndHere
public AllowedMentionsBuilder setMentionEveryoneAndHere(boolean value)
Mentions @everyone and @here.- Parameters:
value
- If @everyone and @here should be mentioned.- Returns:
- The current instance in order to chain call methods.
-
setMentionRepliedUser
public AllowedMentionsBuilder setMentionRepliedUser(boolean value)
Mention the replied user if the message is a reply.- Parameters:
value
- If the replied user should be mentioned.- Returns:
- The current instance in order to chain call methods.
-
addRole
public AllowedMentionsBuilder addRole(java.lang.String roleId)
Adds a role to the list which will be mentioned.- Parameters:
roleId
- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
addRole
public AllowedMentionsBuilder addRole(long roleId)
Adds a role to the list which will be mentioned.- Parameters:
roleId
- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
addRoles
public AllowedMentionsBuilder addRoles(java.util.Collection<java.lang.Long> roleIds)
Adds the roles to the list which will be mentioned.- Parameters:
roleIds
- A collection of role id's which will be mentioned.- Returns:
- The current instance in order to chain call methods.
-
addUser
public AllowedMentionsBuilder addUser(java.lang.String userId)
Adds a user to the list which will be mentioned.- Parameters:
userId
- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
addUser
public AllowedMentionsBuilder addUser(long userId)
Adds a user to the list which will be mentioned.- Parameters:
userId
- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
addUsers
public AllowedMentionsBuilder addUsers(java.util.Collection<java.lang.Long> userIds)
Adds the users to the list which will be mentioned.- Parameters:
userIds
- A collection of user id's which will be mentioned.- Returns:
- The current instance in order to chain call methods.
-
removeRole
public AllowedMentionsBuilder removeRole(java.lang.String roleId)
Removes a role from the list which will be mentioned.- Parameters:
roleId
- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
removeRole
public AllowedMentionsBuilder removeRole(long roleId)
Removes a role from the list which will be mentioned.- Parameters:
roleId
- The id of the role.- Returns:
- The current instance in order to chain call methods.
-
removeRoles
public AllowedMentionsBuilder removeRoles(java.util.Collection<java.lang.Long> roleIds)
Removes the roles from the list which will be mentioned.- Parameters:
roleIds
- A collection of role id's which will be removed from the list.- Returns:
- The current instance in order to chain call methods.
-
removeUser
public AllowedMentionsBuilder removeUser(java.lang.String userId)
Removes a user from the list which will be mentioned.- Parameters:
userId
- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
removeUser
public AllowedMentionsBuilder removeUser(long userId)
Removes a user from the list which will be mentioned.- Parameters:
userId
- The id of the user.- Returns:
- The current instance in order to chain call methods.
-
removeUsers
public AllowedMentionsBuilder removeUsers(java.util.Collection<java.lang.Long> userIds)
Removes the users from the list which will be mentioned.- Parameters:
userIds
- A collection of user id's which will be removed from the list.- Returns:
- The current instance in order to chain call methods.
-
build
public AllowedMentions build()
Creates aAllowedMentions
instance with the given values.- Returns:
- The created permissions instance.
-
-