Class RoleManagerImpl
java.lang.Object
net.dv8tion.jda.internal.requests.RestActionImpl<Void>
net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl<Void>
net.dv8tion.jda.internal.managers.ManagerBase<RoleManager>
net.dv8tion.jda.internal.managers.RoleManagerImpl
- All Implemented Interfaces:
Manager<RoleManager>
,RoleManager
,RestAction<Void>
,AuditableRestAction<Void>
-
Field Summary
Fields inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
LOG
Fields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
Fields inherited from interface net.dv8tion.jda.api.managers.RoleManager
COLOR, HOIST, ICON, MENTIONABLE, NAME, PERMISSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRole()
The targetRole
for this managergivePermissions
(Collection<Permission> perms) Adds the specifiedPermissions
to the selectedRole
.reset()
Resets all fields for this Managerreset
(long fields) Resets the fields specified by the provided bit-flag pattern.reset
(long... fields) Resets the fields specified by the provided bit-flag patterns.revokePermissions
(Collection<Permission> perms) Revokes the specifiedPermissions
from the selectedRole
.setColor
(int rgb) Sets the rgb color of the selectedRole
.setHoisted
(boolean hoisted) Sets the hoist state of the selectedRole
.Sets the Unicode Emoji of thisRole
instead of a custom image.setMentionable
(boolean mentionable) Sets the mentionable state of the selectedRole
.Sets the name of the selectedRole
.setPermissions
(long perms) Sets thePermissions
of the selectedRole
.Methods inherited from class net.dv8tion.jda.internal.managers.ManagerBase
complete, deadline, isPermissionChecksEnabled, queue, setCheck, setPermissionChecksEnabled, timeout
Methods inherited from class net.dv8tion.jda.internal.requests.restaction.AuditableRestActionImpl
reason
Methods inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
getCheck, getDefaultFailure, getDefaultSuccess, getDefaultTimeout, getJDA, handleResponse, isPassContext, priority, setDefaultFailure, setDefaultSuccess, setDefaultTimeout, setErrorMapper, setPassContext, submit
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
Methods inherited from interface net.dv8tion.jda.api.managers.RoleManager
getGuild, givePermissions, revokePermissions, setColor, setIcon, setPermissions, setPermissions
-
Constructor Details
-
RoleManagerImpl
Creates a new RoleManager instance- Parameters:
role
-Role
that should be modified
-
-
Method Details
-
getRole
Description copied from interface:RoleManager
The targetRole
for this manager- Specified by:
getRole
in interfaceRoleManager
- Returns:
- The target Role
-
reset
Description copied from interface:RoleManager
Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(RoleManager.COLOR | RoleManager.NAME);
Flag Constants:
- Specified by:
reset
in interfaceManager<RoleManager>
- Specified by:
reset
in interfaceRoleManager
- Overrides:
reset
in classManagerBase<RoleManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- RoleManager for chaining convenience
-
reset
Description copied from interface:RoleManager
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(RoleManager.COLOR, RoleManager.NAME);
Flag Constants:
- Specified by:
reset
in interfaceManager<RoleManager>
- Specified by:
reset
in interfaceRoleManager
- Overrides:
reset
in classManagerBase<RoleManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- RoleManager for chaining convenience
-
reset
Description copied from interface:Manager
Resets all fields for this Manager- Specified by:
reset
in interfaceManager<RoleManager>
- Overrides:
reset
in classManagerBase<RoleManager>
- Returns:
- The current Manager with all settings reset to default
-
setName
Description copied from interface:RoleManager
Sets the name of the selectedRole
.A role name must not be
null
nor less than 1 character or more than 100 characters long!- Specified by:
setName
in interfaceRoleManager
- Parameters:
name
- The new name for the selectedRole
- Returns:
- RoleManager for chaining convenience
-
setPermissions
Description copied from interface:RoleManager
Sets thePermissions
of the selectedRole
.Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!- Specified by:
setPermissions
in interfaceRoleManager
- Parameters:
perms
- The new raw permission value for the selectedRole
- Returns:
- RoleManager for chaining convenience
- See Also:
-
setColor
Description copied from interface:RoleManager
Sets the rgb color of the selectedRole
.- Specified by:
setColor
in interfaceRoleManager
- Parameters:
rgb
- The new color for the selectedRole
- Returns:
- RoleManager for chaining convenience
- See Also:
-
setHoisted
Description copied from interface:RoleManager
Sets the hoist state of the selectedRole
.- Specified by:
setHoisted
in interfaceRoleManager
- Parameters:
hoisted
- Whether the selectedRole
should be hoisted- Returns:
- RoleManager for chaining convenience
-
setMentionable
Description copied from interface:RoleManager
Sets the mentionable state of the selectedRole
.- Specified by:
setMentionable
in interfaceRoleManager
- Parameters:
mentionable
- Whether the selectedRole
should be mentionable- Returns:
- RoleManager for chaining convenience
-
setIcon
Description copied from interface:RoleManager
- Specified by:
setIcon
in interfaceRoleManager
- Parameters:
icon
- The new icon for thisRole
ornull
to reset- Returns:
- RoleManager for chaining convenience
-
setIcon
Description copied from interface:RoleManager
Sets the Unicode Emoji of thisRole
instead of a custom image.- Specified by:
setIcon
in interfaceRoleManager
- Parameters:
emoji
- The new Unicode Emoji for thisRole
ornull
to reset- Returns:
- RoleManager for chaining convenience
-
givePermissions
@Nonnull @CheckReturnValue public RoleManagerImpl givePermissions(@Nonnull Collection<Permission> perms) Description copied from interface:RoleManager
Adds the specifiedPermissions
to the selectedRole
.Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!- Specified by:
givePermissions
in interfaceRoleManager
- Parameters:
perms
- The permission to give to the selectedRole
- Returns:
- RoleManager for chaining convenience
- See Also:
-
revokePermissions
@Nonnull @CheckReturnValue public RoleManagerImpl revokePermissions(@Nonnull Collection<Permission> perms) Description copied from interface:RoleManager
Revokes the specifiedPermissions
from the selectedRole
.Permissions may only include already present Permissions for the currently logged in account.
You are unable to revoke permissions you don't have!- Specified by:
revokePermissions
in interfaceRoleManager
- Parameters:
perms
- The permission to give to the selectedRole
- Returns:
- RoleManager for chaining convenience
- See Also:
-