> For the complete documentation index, see [llms.txt](https://glitchtechs.gitbook.io/galaxy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glitchtechs.gitbook.io/galaxy/starapi-spigot-paper/builders/webhook-builder.md).

# Webhook Builder

Use webhooks in your projects with ease

### Overview

The `WebhookBuilder` class facilitates the sending of messages to Discord webhooks in a Minecraft Bukkit server environment. It provides a simple interface for constructing and sending webhook messages to specified URLs.

### Constructor

#### `WebhookBuilder`

```java
private WebhookBuilder(String webhookUrl)
```

Initializes a new instance of the `WebhookBuilder` class with the specified webhook URL.

**Parameters**

* `webhookUrl`: The URL of the Discord webhook.

### Static Factory Method

#### `create`

```java
public static WebhookBuilder create(String webhookUrl)
```

Creates a new `WebhookBuilder` instance with the specified webhook URL.

**Parameters**

* `webhookUrl`: The URL of the Discord webhook.

### Methods

#### `addMessage`

```java
public WebhookBuilder addMessage(String message)
```

Adds a message to be sent via the webhook.

**Parameters**

* `message`: The message to be sent.

#### `build`

```java
public void build()
```

Builds and sends the constructed message to the Discord webhook.

### Notes

* The `WebhookBuilder` class provides a convenient way to send messages to Discord webhooks.
* Developers can use the `addMessage` method to add messages to the webhook.
* Once configured, the message can be built and sent to the webhook using the `build` method.
* This allows for seamless integration of Minecraft server events or notifications with Discord channels.
