public class WebhookManager
extends net.dv8tion.jda.core.managers.impl.ManagerBase
Webhook.
Example
manager.setName("GitHub Webhook")
.setChannel(channel)
.queue();
manager.reset(WebhookManager.NAME | WebhookManager.AVATAR)
.setName("Meme Feed")
.setAvatar(null)
.queue();
Webhook.getManager()AuditableRestAction.EmptyRestAction<T>| Modifier and Type | Field | Description |
|---|---|---|
static long |
AVATAR |
Used to reset the avatar field
|
static long |
CHANNEL |
Used to reset the channel field
|
static long |
NAME |
Used to reset the name field
|
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG| Constructor | Description |
|---|---|
WebhookManager(Webhook webhook) |
Creates a new WebhookManager instance
|
| Modifier and Type | Method | Description |
|---|---|---|
TextChannel |
getChannel() |
The
TextChannel this Manager's
Webhook is in. |
Guild |
getGuild() |
|
Webhook |
getWebhook() |
The target
Webhook
that will be modified by this manager |
WebhookManager |
reset() |
Resets all fields for this manager.
|
WebhookManager |
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 selected
Webhook. |
WebhookManager |
setChannel(TextChannel channel) |
Sets the
TextChannel of the selected Webhook. |
WebhookManager |
setName(java.lang.String name) |
Sets the default name of the selected
Webhook. |
reason, setCheckcomplete, isPermissionChecksEnabled, queue, setPermissionChecksEnabledequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, completeAfter, getJDA, isPassContext, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfterpublic static final long NAME
public static final long CHANNEL
public static final long AVATAR
public Guild getGuild()
Guild this Manager's
Webhook is in.
getWebhook().getGuild()Guildpublic TextChannel getChannel()
TextChannel this Manager's
Webhook is in.
getWebhook().getChannel()TextChannelpublic Webhook getWebhook()
Webhook
that will be modified by this managerWebhook@CheckReturnValue public WebhookManager reset(long fields)
manager.reset(WebhookManager.CHANNEL | WebhookManager.NAME);
Flag Constants:
reset in class net.dv8tion.jda.core.managers.impl.ManagerBasefields - Integer value containing the flags to reset.@CheckReturnValue public WebhookManager reset(long... fields)
manager.reset(WebhookManager.CHANNEL, WebhookManager.NAME);
Flag Constants:
reset in class net.dv8tion.jda.core.managers.impl.ManagerBasefields - Integer values containing the flags to reset.@CheckReturnValue public WebhookManager reset()
reset in class net.dv8tion.jda.core.managers.impl.ManagerBase@CheckReturnValue public WebhookManager setName(java.lang.String name)
Webhook.
A webhook name must not be null or blank!
name - The new default name for the selected Webhookjava.lang.IllegalArgumentException - If the provided name is null or blank@CheckReturnValue public WebhookManager setAvatar(Icon icon)
Webhook.@CheckReturnValue public WebhookManager setChannel(TextChannel channel)
TextChannel of the selected Webhook.
A webhook channel must not be null and must be in the same Guild!
channel - The new TextChannel
for the selected WebhookInsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_WEBHOOKS
in the specified TextChanneljava.lang.IllegalArgumentException - If the provided channel is null or from a different Guild