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 TextChannelgetChannel()TheTextChannelthis Manager'sWebhookis in.default GuildgetGuild()WebhookgetWebhook()The targetWebhookthat will be modified by this managerWebhookManagerreset(long fields)Resets the fields specified by the provided bit-flag pattern.WebhookManagerreset(long... fields)Resets the fields specified by the provided bit-flag patterns.WebhookManagersetAvatar(Icon icon)Sets the default avatar of the selectedWebhook.WebhookManagersetChannel(TextChannel channel)Sets theTextChannelof the selectedWebhook.WebhookManagersetName(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:
resetin 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:
resetin interfaceManager<WebhookManager>- Parameters:
fields- Integer values containing the flags to reset.- Returns:
- WebhookManager for chaining convenience
-
getWebhook
@Nonnull Webhook getWebhook()
The targetWebhookthat will be modified by this manager- Returns:
- The target
Webhook
-
getChannel
@Nonnull default TextChannel getChannel()
TheTextChannelthis Manager'sWebhookis in.
This is logically the same as callinggetWebhook().getChannel()- Returns:
- The parent
TextChannel
-
getGuild
@Nonnull default Guild getGuild()
TheGuildthis Manager'sWebhookis 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
nullor blank!- Parameters:
name- The new default name for the selectedWebhook- Returns:
- WebhookManager for chaining convenience
- Throws:
java.lang.IllegalArgumentException- If the provided name isnullor 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 theTextChannelof the selectedWebhook.A webhook channel must not be
nulland must be in the sameGuild!- Parameters:
channel- The newTextChannelfor the selectedWebhook- Returns:
- WebhookManager for chaining convenience
- Throws:
InsufficientPermissionException- If the currently logged in account does not have the PermissionMANAGE_WEBHOOKSin the specified TextChanneljava.lang.IllegalArgumentException- If the provided channel isnullor from a different Guild
-
-