Bot that posts messages to telegram channel
const bot = new TelegramPostBot('<token>');
bot.sendMessage('@channelusername', '<b>message</b> <a href="http://www.example.com/">inline URL</a>', 'HTML', false);
Class represents telegram bot
Parameters
token
string telegram bot's authentication token
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 messageparseMode
{string} - mode: Markdown or HTML to show bold/italic text and inline URLS in messagewebpagePreviewOff
{boolean} - true to disable link previews
Extends Error
Class represents custom error for Bad Request response
Parameters
message
(string | null) error message (optional, defaultnull
)