UNPKG

@jackdbd/notifications

Version:

Functions used to send notifications to various channels (Telegram, email, etc)

45 lines 1.26 kB
export interface Config { /** * Unique identifier for the target chat or username of the target Telegram * channel (in the format \@channelusername). */ chat_id: string; /** * Text of the message to be sent, 1-4096 characters after entities parsing. */ text: string; /** * The token of your Telegram bot. * https://core.telegram.org/bots/api#authorizing-your-bot */ token: string; } export interface Options { /** * Sends the message silently. Users will receive a notification with no sound. */ disable_notification?: boolean; /** * Disables link previews for links in this message. */ disable_web_page_preview?: boolean; /** * https://core.telegram.org/bots/api#formatting-options */ parse_mode?: 'HTML' | 'MarkdownV2'; } /** * Send a text message to a Telegram chat, using the Telegram API. * * https://core.telegram.org/bots/api#sendmessage */ export declare const send: ({ chat_id, text, token }: Config, options?: Options) => Promise<{ delivered: boolean; message: string; delivered_at?: undefined; } | { delivered: boolean; delivered_at: string; message: string; }>; //# sourceMappingURL=telegram.d.ts.map