Telegram
Post a Vercel event into a Telegram chat
Set both TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. The bot can only post into a chat that has started it, or into a group or channel it belongs to.
Create the bot
- Message @BotFather and send
/newbot. - Copy the token into
TELEGRAM_BOT_TOKEN.
Your user id
Use this when Versend should DM you.
- Open the bot and send
/start. Telegram drops a DM to a bot that was never started. - Message @userinfobot. The
Idin its reply is your user id. That same number is the private chat id. - Put the positive number in
TELEGRAM_CHAT_ID.
You can read the same id from the Bot API. After /start, open this in a browser and replace <token>:
https://api.telegram.org/bot<token>/getUpdatesFind "chat": { "id": 123456789 } on your message. That URL contains the bot token. Don't share it.
A group
- Add the bot to the group and send a message there.
- Open
getUpdatesagain. The chat id is negative. A supergroup looks like-1001234567890. - Put that id in
TELEGRAM_CHAT_ID.
If getUpdates stays empty, privacy mode is hiding ordinary group messages. Send /setprivacy to @BotFather, pick the bot, and turn privacy off. Then send another message in the group.
A channel
- Add the bot as an administrator with permission to post.
- A public channel accepts
@channelnameasTELEGRAM_CHAT_ID. - For the numeric id, forward a channel post to @userinfobot and use the forwarded chat id, including the
-100prefix.
getUpdates does not list channel posts.
A message looks like this. Open is the live deployment. Inspect is the Vercel inspector.
✅ Deployment ready
my-app
production · main · a1b2c3d
feat: add billing
Open · Inspect