UNPKG

@vermaysha/discord-webhook

Version:

Discord Webhook built using TypeScript which supports Browser and Node

26 lines (25 loc) 977 B
import { AxiosPromise } from 'axios'; import type { IAttachment, IEmbed, IWebhook, IWebhookParameter, IWebhookResponse } from '../Interfaces'; import { Embed } from './Embed'; import { Request } from './Request'; export declare class Webhook { protected client: Request; protected username?: string; protected avatar_url?: string; protected tts?: boolean; protected content?: string; protected file?: IAttachment | string; protected embeds?: Array<IEmbed>; constructor(webhookUrl: string); setUsername(username: string): Webhook; setAvatarUrl(url: string): Webhook; setTTS(flag: boolean): Webhook; setContent(content: string): Webhook; addEmbed(embed: Embed): Webhook; setFile(file: IAttachment | string): Webhook; send(): Promise<unknown>; modify(options: IWebhookParameter): AxiosPromise<IWebhookResponse>; get(): AxiosPromise<IWebhookResponse>; isValid(): Promise<boolean>; toObject(): IWebhook; }