Skip to main content
Module

x/harmony/mod.ts>Webhook

An easy to use Discord API Library for Deno.
Latest
class Webhook
import { Webhook } from "https://deno.land/x/harmony@v2.9.0/mod.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

create(
channel: string | TextChannel,
client: Client,
body: WebhookCreateOptions,
): Promise<Webhook>
fromURL(url: string | URL, client?: Client): Promise<Webhook>

Creates a Webhook object from URL