Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/harmony/src/structures/webhook.ts>Webhook

An easy to use Discord API Library for Deno.
Go to Latest
class Webhook
import { Webhook } from "https://deno.land/x/harmony@v2.8.0/src/structures/webhook.ts";

Webhook follows different way of instantiation

Constructors

new
Webhook(
client?: Client,
rest?: RESTManager,
)

Properties

optional
applicationID: string
optional
avatar: string
channelID: string
optional
client: Client
optional
guildID: string
id: string
optional
name: string
optional
token: string
type: 1 | 2
readonly
url: string
optional
user: User
optional
userRaw: UserPayload

Methods

private
fromPayload(data: WebhookPayload): this
delete(): Promise<boolean>

Deletes the Webhook.

deleteMessage(message: string | Message): Promise<Webhook>
edit(options: WebhookEditOptions): Promise<Webhook>

Edits the Webhook name, avatar, or channel (requires authentication).

editMessage(message: string | Message, data: { content?: string; embeds?: Embed[]; file?: MessageAttachment; allowed_mentions?: { parse?: string; roles?: string[]; users?: string[]; everyone?: boolean; }; }): Promise<Webhook>
send(text?: string | AllWebhookMessageOptions, option?: AllWebhookMessageOptions): Promise<Message>

Sends a Message through Webhook.

Static Methods

fromURL(url: string | URL, client?: Client): Promise<Webhook>

Creates a Webhook object from URL