Package net.dv8tion.jda.api.managers
Interface TemplateManager
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<TemplateManager>
,RestAction<Void>
Manager providing functionality to update one or more fields for a
Template
.
Example
manager.setName("backup")
.setDescription("backup for our server")
.queue();
manager.reset(TemplateManager.DESCRIPTION | TemplateManager.NAME)
.setName("server template")
.setDescription(null)
.queue();
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the description fieldstatic final long
Used to reset the name fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionreset
(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.setDescription
(String description) Sets the description of thisTemplate
.Sets the name of thisTemplate
.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
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
-
Field Details
-
NAME
static final long NAMEUsed to reset the name field- See Also:
-
DESCRIPTION
static final long DESCRIPTIONUsed to reset the description field- See Also:
-
-
Method Details
-
reset
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(TemplateManager.NAME | TemplateManager.DESCRIPTION);
Flag Constants:
- Specified by:
reset
in interfaceManager<TemplateManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- TemplateManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(TemplateManager.NAME, TemplateManager.DESCRIPTION);
Flag Constants:
- Specified by:
reset
in interfaceManager<TemplateManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- TemplateManager for chaining convenience
-
setName
Sets the name of thisTemplate
.- Parameters:
name
- The new name for thisTemplate
- Returns:
- TemplateManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided name isnull
or not between 1-100 characters long
-
setDescription
Sets the description of thisTemplate
.- Parameters:
description
- The new description for thisTemplate
- Returns:
- TemplateManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided description is not between 0-120 characters long
-