UNPKG

send-discord-webhook

Version:

Easily send a Discord webhook with Typescript syntax support

51 lines (50 loc) 1.14 kB
type DiscordWebhookField = { name: string; value: string; inline?: boolean; }; type DiscordEmbedAuthor = { name: string; url?: string; icon_url?: string; }; type DiscordEmbedFooter = { text: string; icon_url?: string; }; type DiscordEmbed = { title: string; description: string; url?: string; color?: number; fields?: DiscordWebhookField[]; author?: DiscordEmbedAuthor; thumbnail?: { url: string; }; image?: { url: string; }; footer?: DiscordEmbedFooter; timestamp?: string; }; type AllowedMentionTypes = "roles" | "users" | "everyone"; export type DiscordWebhookOptions = { url: string; username?: string; avatar_url?: string; content?: string; embeds?: DiscordEmbed[]; thread_id?: string; allowedMentions?: { parse?: AllowedMentionTypes[]; users?: string[]; roles?: string[]; }; title?: string; description?: string; fields?: DiscordWebhookField[]; color?: number; }; export declare const sendDiscordWebhook: (options: DiscordWebhookOptions) => Promise<boolean>; export {};