Class RoleBuilder
- java.lang.Object
-
- org.javacord.api.entity.permission.RoleBuilder
-
public class RoleBuilder extends java.lang.ObjectThis class is used to create roles.
-
-
Constructor Summary
Constructors Constructor Description RoleBuilder(Server server)Creates a new role role builder for the given server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<Role>create()Creates the role.RoleBuildersetAuditLogReason(java.lang.String reason)Sets the reason for the creation.RoleBuildersetColor(java.awt.Color color)Sets the color of the role.RoleBuildersetDisplaySeparately(boolean displaySeparately)Sets if the role should be pinned in the user listing (sometimes called "hoist").RoleBuildersetMentionable(boolean mentionable)Sets if the role is mentionable or not.RoleBuildersetName(java.lang.String name)Sets the name of the role.RoleBuildersetPermissions(Permissions permissions)Sets the permissions of the role.
-
-
-
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(java.lang.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(java.lang.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(java.awt.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 tofalse.- 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 java.util.concurrent.CompletableFuture<Role> create()
Creates the role.- Returns:
- The created role.
-
-