Webhook

Create Webhook

PostAPIChannelWebhook

Creates a new webhook and returns a webhook object on success.

import { createWebhook } from "dressed";
await createWebhook(channelId, data);
Info

Requires the MANAGE_WEBHOOKS permission.

List Channel Webhooks

GetAPIChannelWebhooks

Returns a list of channel webhook objects.

import { listChannelWebhooks } from "dressed";
const channelWebhooks = await listChannelWebhooks(channelId);
Info

Requires the MANAGE_WEBHOOKS permission.

List Guild Webhooks

GetAPIGuildWebhooks

Returns a list of guild webhook objects.

import { listGuildWebhooks } from "dressed";
const guildWebhooks = await listGuildWebhooks(guildId);
Info

Requires the MANAGE_WEBHOOKS permission.

Get Webhook

GetAPIWebhook

Returns the new webhook object for the given id.

import { getWebhook } from "dressed";
const webhook = await getWebhook(webhookId, webhookToken?);
Info

This request requires the MANAGE_WEBHOOKS permission unless the application making the request owns the webhook. (see: webhook.application_id)

Modify Webhook

PatchAPIWebhook

Modify a webhook.

import { modifyWebhook } from "dressed";
await modifyWebhook(webhookId, data, webhookToken?);
Info

Requires the MANAGE_WEBHOOKS permission.

Delete Webhook

DeleteAPIWebhook

Delete a webhook permanently.

import { deleteWebhook } from "dressed";
await deleteWebhook(webhookId, webhookToken?);
Info

Requires the MANAGE_WEBHOOKS permission.

Execute Webhook

PostAPIWebhookWithToken

Execute a webhook.

import { executeWebhook } from "dressed";
await executeWebhook(webhookId, webhookToken, data, params?);
Info
  • If the webhook channel is a forum or media channel, you must provide either thread_id in the query string params, or thread_name in the JSON/form params. If thread_id is provided, the message will send in that thread. If thread_name is provided, a thread with that name will be created in the channel.
  • For the webhook embed objects, you can set every field except type (it will be rich regardless of if you try to set it), provider, video, and any height, width, or proxy_url values for images.

Get Webhook Message

GetAPIWebhookWithTokenMessage

Returns a previously-sent webhook message from the same token.

import { getWebhookMessage } from "dressed";
const webhookMessage = await getWebhookMessage(webhookId, webhookToken, messageId, params?);

Edit Webhook Message

PatchAPIWebhookWithTokenMessage

Edits a previously-sent webhook message from the same token.

import { editWebhookMessage } from "dressed";
await editWebhookMessage(webhookId, webhookToken, messageId, data, params?);
Warning

Starting with API v10, the attachments array must contain all attachments that should be present after edit, including retained and new attachments provided in the request body.

Delete Webhook Message

DeleteAPIWebhookWithTokenMessage

Deletes a message that was created by the webhook.

import { deleteWebhookMessage } from "dressed";
await deleteWebhookMessage(webhookId, webhookToken, messageId, params?);