Package net.dv8tion.jda.api.managers
Interface WebhookManager
- All Superinterfaces:
AuditableRestAction<Void>
,Manager<WebhookManager>
,RestAction<Void>
Manager providing functionality to update one or more fields for a
Webhook
.
Example
manager.setName("GitHub Webhook")
.setChannel(channel)
.queue();
manager.reset(WebhookManager.NAME | WebhookManager.AVATAR)
.setName("Meme Feed")
.setAvatar(null)
.queue();
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Used to reset the avatar fieldstatic final long
Used to reset the channel 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 TypeMethodDescriptiondefault IWebhookContainerUnion
default Guild
getGuild()
The targetWebhook
that will be modified by 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.Sets the default avatar of the selectedWebhook
.setChannel
(TextChannel channel) Sets theTextChannel
of the selectedWebhook
.Sets the default name of the selectedWebhook
.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:
-
CHANNEL
static final long CHANNELUsed to reset the channel field- See Also:
-
AVATAR
static final long AVATARUsed to reset the avatar 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(WebhookManager.CHANNEL | WebhookManager.NAME);
Flag Constants:
- Specified by:
reset
in interfaceManager<WebhookManager>
- Parameters:
fields
- Integer value containing the flags to reset.- Returns:
- WebhookManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns.
Example:manager.reset(WebhookManager.CHANNEL, WebhookManager.NAME);
Flag Constants:
- Specified by:
reset
in interfaceManager<WebhookManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- WebhookManager for chaining convenience
-
getWebhook
The targetWebhook
that will be modified by this manager- Returns:
- The target
Webhook
-
getChannel
Thechannel
that this Manager'sWebhook
is in.
This is logically the same as callinggetWebhook().getChannel()
- Returns:
- The parent
IWebhookContainer
instance.
-
getGuild
TheGuild
this Manager'sWebhook
is in.
This is logically the same as callinggetWebhook().getGuild()
- Returns:
- The parent
Guild
-
setName
Sets the default name of the selectedWebhook
.A webhook name must not be
null
or blank!- Parameters:
name
- The new default name for the selectedWebhook
- Returns:
- WebhookManager for chaining convenience
- Throws:
IllegalArgumentException
- If the provided name isnull
or blank
-
setAvatar
Sets the default avatar of the selectedWebhook
. -
setChannel
Sets theTextChannel
of the selectedWebhook
.A webhook channel must not be
null
and must be in the sameGuild
!- Parameters:
channel
- The newTextChannel
for the selectedWebhook
- Returns:
- WebhookManager for chaining convenience
- Throws:
InsufficientPermissionException
- If the currently logged in account does not have the PermissionMANAGE_WEBHOOKS
in the specified TextChannelIllegalArgumentException
- If the provided channel isnull
or from a different Guild
-