@tycrek/discord-hookr
Version:
A lightweight and easy way to send webhooks to Discord, without the added baggage of a full API client.
22 lines (21 loc) • 895 B
TypeScript
import { EmbedBuilder } from './EmbedBuilder';
import { AllowedMention, Embed } from './ApiTypes';
export declare class Webhook {
private hookUrl;
private payload;
constructor(webhookUrl: string);
setContent(content: string): this;
setUsername(username: string): this;
setAvatar(avatarUrl: string): this;
setTts(tts: boolean): this;
setAllowedMentions(allowedMentions: AllowedMention): this;
setComponents(components: any[]): this;
setPayloadJson(payloadJson: string): this;
setFlags(flags: number): this;
setThreadName(threadName: string): this;
addAttachment(attachment: any): this;
addEmbed(embed: EmbedBuilder | Embed | (EmbedBuilder | Embed)[]): this;
sendFile(filePath: string, username?: string, avatarUrl?: string): Promise<unknown>;
sendText(text: string): Promise<void>;
send(): Promise<void>;
}