Docs / Services

Telegram

Send notifications via Telegram bot messages to any chat or group.

URL format

scheme
tgram://bot_token/chat_id
Segment Required Description
bot_token Yes Bot token from BotFather (e.g. 123456789:AABBccDDeeff...)
chat_id Yes Numeric chat ID or username (e.g. -1001234567890)

Example

typescript
import { notify } from '@ambersecurityinc/notifly';

await notify(
  { urls: ['tgram://123456789:AABBccDDeeff/-1001234567890'] },
  { title: 'Server Alert', body: 'CPU at 98%', type: 'failure' }
);

Finding your credentials

Bot token

  1. Open Telegram and search for @BotFather.
  2. Send /newbot and follow the prompts.
  3. BotFather will reply with your bot token — it looks like 123456789:AABBccDDeeff....
  4. Keep this token secret — it's the password to your bot.

Chat ID

  1. Add your bot to the target chat or group.
  2. Send a message in the chat, then open in a browser:
    api url
    https://api.telegram.org/bot{YOUR_BOT_TOKEN}/getUpdates
  3. Look for chat.id in the JSON response.
  4. Alternatively, forward a message to @userinfobot to get your personal chat ID.

Quirks & limitations

  • Group chat IDs are negative numbers (prefixed with -). Supergroup IDs start with -100.
  • The bot must be a member of the chat before it can send messages.
  • Telegram supports basic HTML and Markdown formatting in message bodies.
← Previous Slack Next → Microsoft Teams