Class RoleBuilder



  • public class RoleBuilder
    extends Object
    This class is used to create roles.
    • Constructor Detail

      • RoleBuilder

        public RoleBuilder​(Server server)
        Creates a new role role builder for the given server.
        Parameters:
        server - The server for which the role should be created.
    • Method Detail

      • setAuditLogReason

        public RoleBuilder setAuditLogReason​(String reason)
        Sets the reason for the creation. This reason will be visible in the audit log entry(s).
        Parameters:
        reason - The reason for this update.
        Returns:
        The current instance in order to chain call methods.
      • setName

        public RoleBuilder setName​(String name)
        Sets the name of the role. By default it's "new role".
        Parameters:
        name - The name of the role.
        Returns:
        The current instance in order to chain call methods.
      • setPermissions

        public RoleBuilder setPermissions​(Permissions permissions)
        Sets the permissions of the role. By default it uses the permissions of the @everyone role.
        Parameters:
        permissions - The permissions to set.
        Returns:
        The current instance in order to chain call methods.
      • setColor

        public RoleBuilder setColor​(Color color)
        Sets the color of the role.
        Parameters:
        color - The color of the role.
        Returns:
        The current instance in order to chain call methods.
      • setMentionable

        public RoleBuilder setMentionable​(boolean mentionable)
        Sets if the role is mentionable or not. By default it's set to false.
        Parameters:
        mentionable - Whether the role should be mentionable or not.
        Returns:
        The current instance in order to chain call methods.
      • setDisplaySeparately

        public RoleBuilder setDisplaySeparately​(boolean displaySeparately)
        Sets if the role should be pinned in the user listing (sometimes called "hoist").
        Parameters:
        displaySeparately - Whether the role should be pinned in the user listing or not.
        Returns:
        The current instance in order to chain call methods.
      • create

        public CompletableFuture<Role> create​()
        Creates the server text channel.
        Returns:
        The created text channel.