Package org.javacord.api.entity.webhook
Class WebhookBuilder
- java.lang.Object
-
- org.javacord.api.entity.webhook.WebhookBuilder
-
public class WebhookBuilder extends java.lang.ObjectThis class can be used to create webhooks.
-
-
Constructor Summary
Constructors Constructor Description WebhookBuilder(ServerTextChannel channel)Creates a new webhook builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<IncomingWebhook>create()Creates the webhook.WebhookBuildersetAuditLogReason(java.lang.String reason)Sets the reason for this update.WebhookBuildersetAvatar(byte[] avatar)Sets the avatar.WebhookBuildersetAvatar(byte[] avatar, java.lang.String fileType)Sets the avatar.WebhookBuildersetAvatar(java.awt.image.BufferedImage avatar)Sets the avatar.WebhookBuildersetAvatar(java.awt.image.BufferedImage avatar, java.lang.String fileType)Sets the avatar.WebhookBuildersetAvatar(java.io.File avatar)Sets the avatar.WebhookBuildersetAvatar(java.io.InputStream avatar)Sets the avatar.WebhookBuildersetAvatar(java.io.InputStream avatar, java.lang.String fileType)Sets the avatar.WebhookBuildersetAvatar(java.net.URL avatar)Sets the avatar.WebhookBuildersetAvatar(Icon avatar)Sets the avatar.WebhookBuildersetName(java.lang.String name)Sets the name.
-
-
-
Constructor Detail
-
WebhookBuilder
public WebhookBuilder(ServerTextChannel channel)
Creates a new webhook builder.- Parameters:
channel- The server text channel of the webhook.
-
-
Method Detail
-
setAuditLogReason
public WebhookBuilder setAuditLogReason(java.lang.String reason)
Sets the reason for this update. This reason will be visible in the audit log entry(s).- Parameters:
reason- The reason for this update.- Returns:
- The current instance in order to chain call methods.
-
setName
public WebhookBuilder setName(java.lang.String name)
Sets the name.- Parameters:
name- The new name of the webhook.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.awt.image.BufferedImage avatar)
Sets the avatar. This method assumes the file type is "png"!- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.awt.image.BufferedImage avatar, java.lang.String fileType)
Sets the avatar.- Parameters:
avatar- The avatar to set.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.io.File avatar)
Sets the avatar.- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(Icon avatar)
Sets the avatar.- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.net.URL avatar)
Sets the avatar.- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(byte[] avatar)
Sets the avatar. This method assumes the file type is "png"!- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(byte[] avatar, java.lang.String fileType)
Sets the avatar.- Parameters:
avatar- The avatar to set.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.io.InputStream avatar)
Sets the avatar. This method assumes the file type is "png"!- Parameters:
avatar- The avatar to set.- Returns:
- The current instance in order to chain call methods.
-
setAvatar
public WebhookBuilder setAvatar(java.io.InputStream avatar, java.lang.String fileType)
Sets the avatar.- Parameters:
avatar- The avatar to set.fileType- The type of the avatar, e.g. "png" or "jpg".- Returns:
- The current instance in order to chain call methods.
-
create
public java.util.concurrent.CompletableFuture<IncomingWebhook> create()
Creates the webhook.- Returns:
- The created webhook.
-
-