> For the complete documentation index, see [llms.txt](https://legacy.docs.touchguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy.docs.touchguild.com/documentation/select-version/v.0.1.7/components/webhook.md).

# Webhook

## Properties

| Property    | Description                                            | Type                                                                 |
| ----------- | ------------------------------------------------------ | -------------------------------------------------------------------- |
| \_client    | Client                                                 | [Client](/documentation/select-version/v.0.1.7/components/client.md) |
| id          | ID of the webhook                                      | String                                                               |
| guildID     | ID of the guild the webhook got sent on.               | String                                                               |
| channelID   | ID of the channel the webhook got sent on.             | String                                                               |
| username    | Webhook username.                                      | String                                                               |
| \_createdAt | Timestamp (unix epoch time) of the webhook's creation. | Number                                                               |
| \_deletedAt | Timestamp (unix epoch time) of the webhook's deletion. | Number\|null                                                         |
| createdBy   | ID of the webhook's owner.                             | String                                                               |
| token       | Webhook token                                          | String\|null                                                         |
| createdAt   | String representation of the \_createdAt timestamp.    | Date                                                                 |
| deletedAt   | String representation of the \_deletedAt timestamp.    | Date\|null                                                           |

## Constructor

```javascript
new Webhook(rawData, client)
```

| Properties | Description                                     | Type                                                                 | Required? |
| ---------- | ----------------------------------------------- | -------------------------------------------------------------------- | --------- |
| rawData    | raw data received from ws and converted to JSON | Object                                                               | true      |
| client     | Client                                          | [Client](/documentation/select-version/v.0.1.7/components/client.md) | true      |

{% hint style="danger" %}
Do not use this constructor unless you know what you're doing. This constructor is used to return you rawdata into component.
{% endhint %}

## Methods

### edit()

Edit the webhook.

| Properties         | Description                      | Type   | Required? |
| ------------------ | -------------------------------- | ------ | --------- |
| options            | Edit options.                    | Object | true      |
| options.name       | New webhook's name.              | String | true      |
| options.channelID? | Move webhook to another channel. | String | false     |

> Returns: <mark style="color:purple;">Promise<</mark>[<mark style="color:purple;">Webhook</mark>](/documentation/select-version/v.0.1.7/components/webhook.md)<mark style="color:purple;">></mark>

### delete()

Delete the webhook.

> Returns: <mark style="color:purple;">Promise\<void></mark>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy.docs.touchguild.com/documentation/select-version/v.0.1.7/components/webhook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
