Class AllowedMentionsBuilder


  • public class AllowedMentionsBuilder
    extends java.lang.Object
    This class is used to create mentions.
    • Constructor Detail

      • AllowedMentionsBuilder

        public AllowedMentionsBuilder()
    • 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 via addRole(long) or addRoles(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 via addUser(long) or addUsers(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.