public class WebhookManager
extends java.lang.Object
WebhookManagerUpdatable instance.
This decoration allows to modify a single field by automatically building an update RestAction
| Constructor and Description |
|---|
WebhookManager(Webhook webhook)
Creates a new WebhookManager instance
|
| Modifier and Type | Method and Description |
|---|---|
TextChannel |
getChannel()
The
TextChannel this Manager's
Webhook is in. |
Guild |
getGuild()
|
JDA |
getJDA()
The
JDA instance of this Manager |
Webhook |
getWebhook()
The target
Webhook
that will be modified by this manager |
AuditableRestAction<java.lang.Void> |
setAvatar(Icon icon)
Sets the default avatar of the selected
Webhook. |
AuditableRestAction<java.lang.Void> |
setChannel(TextChannel channel)
Sets the
TextChannel of the selected Webhook. |
AuditableRestAction<java.lang.Void> |
setName(java.lang.String name)
Sets the default name of the selected
Webhook. |
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 AuditableRestAction<java.lang.Void> setName(java.lang.String name)
Webhook.
WebhookManagerUpdatable.getNameField()
A webhook name must not be null!
name - The new default name for the selected WebhookAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_WEBHOOKSjava.lang.IllegalArgumentException - If the provided name is nullWebhookManagerUpdatable.getNameField(),
WebhookManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> setAvatar(Icon icon)
icon - The new default avatar Icon
for the selected WebhookAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_WEBHOOKSWebhookManagerUpdatable.getAvatarField(),
WebhookManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> setChannel(TextChannel channel)
TextChannel of the selected Webhook.
WebhookManagerUpdatable.getChannelField()
A webhook channel must not be null and must be in the same Guild!
channel - The new TextChannel
for the selected WebhookAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_WEBHOOKS
in either the current or the specified TextChanneljava.lang.IllegalArgumentException - If the provided channel is null or from a different GuildWebhookManagerUpdatable.getChannelField(),
WebhookManagerUpdatable.update()