Package net.dv8tion.jda.api.managers
Interface WebhookManager
-
- All Superinterfaces:
AuditableRestAction<java.lang.Void>
,Manager<WebhookManager>
,RestAction<java.lang.Void>
public interface WebhookManager extends Manager<WebhookManager>
Manager providing functionality to update one or more fields for aWebhook
.Example
manager.setName("GitHub Webhook") .setChannel(channel) .queue(); manager.reset(WebhookManager.NAME | WebhookManager.AVATAR) .setName("Meme Feed") .setAvatar(null) .queue();
- See Also:
Webhook.getManager()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default TextChannel
getChannel()
TheTextChannel
this Manager'sWebhook
is in.default Guild
getGuild()
Webhook
getWebhook()
The targetWebhook
that will be modified by this managerWebhookManager
reset(long fields)
Resets the fields specified by the provided bit-flag pattern.WebhookManager
reset(long... fields)
Resets the fields specified by the provided bit-flag patterns.WebhookManager
setAvatar(Icon icon)
Sets the default avatar of the selectedWebhook
.WebhookManager
setChannel(TextChannel channel)
Sets theTextChannel
of the selectedWebhook
.WebhookManager
setName(java.lang.String name)
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, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Field Detail
-
NAME
static final long NAME
Used to reset the name field- See Also:
- Constant Field Values
-
CHANNEL
static final long CHANNEL
Used to reset the channel field- See Also:
- Constant Field Values
-
AVATAR
static final long AVATAR
Used to reset the avatar field- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
@Nonnull WebhookManager reset(long fields)
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
@Nonnull WebhookManager reset(long... fields)
Resets the fields specified by the provided bit-flag patterns. 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 values containing the flags to reset.- Returns:
- WebhookManager for chaining convenience
-
getWebhook
@Nonnull Webhook getWebhook()
The targetWebhook
that will be modified by this manager- Returns:
- The target
Webhook
-
getChannel
@Nonnull default TextChannel getChannel()
TheTextChannel
this Manager'sWebhook
is in.
This is logically the same as callinggetWebhook().getChannel()
- Returns:
- The parent
TextChannel
-
getGuild
@Nonnull default Guild getGuild()
TheGuild
this Manager'sWebhook
is in.
This is logically the same as callinggetWebhook().getGuild()
- Returns:
- The parent
Guild
-
setName
@Nonnull @CheckReturnValue WebhookManager setName(@Nonnull java.lang.String name)
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:
java.lang.IllegalArgumentException
- If the provided name isnull
or blank
-
setAvatar
@Nonnull @CheckReturnValue WebhookManager setAvatar(@Nullable Icon icon)
Sets the default avatar of the selectedWebhook
.
-
setChannel
@Nonnull @CheckReturnValue WebhookManager setChannel(@Nonnull TextChannel channel)
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 TextChanneljava.lang.IllegalArgumentException
- If the provided channel isnull
or from a different Guild
-
-