Skip to content

finnishfox/telegram-post-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram post bot

Bot that posts messages to telegram channel

Usage

const bot = new TelegramPostBot('<token>');
bot.sendMessage('@channelusername', '<b>message</b> <a href="http://www.example.com/">inline URL</a>', 'HTML', false);

Documentation

Table of Contents

TelegramPostBot

Class represents telegram bot

Parameters

  • token string telegram bot's authentication token

sendMessage

Send message to telegram channel

Parameters

  • chatId {string} - unique identifier for the target chat or username of the target channel (id or @username)
  • text {string} - text of message
  • parseMode {string} - mode: Markdown or HTML to show bold/italic text and inline URLS in message
  • webpagePreviewOff {boolean} - true to disable link previews

ErrorBadRequest

Extends Error

Class represents custom error for Bad Request response

Parameters

  • message (string | null) error message (optional, default null)

Releases

No releases published

Packages

No packages published