Building a Claude-Powered Telegram Bot: ID Setup Guide

How to use your Telegram User ID when building Claude Code or Claude Agent-powered Telegram bots for access control.

/newbot TOKEN:abc...
Step 01

Get Your ID & Create a Bot

Message @userid_checkbot for your User ID. Then message @BotFather, send /newbot, and save the API token it returns. Store both as environment variables.

12345678
Step 02

Build & Whitelist

Wire Telegram messages to Claude via the Anthropic API. Before processing any message, check message.from.id against your ALLOWED_USERS list to block unauthorized access.

Step 03

Deploy & Verify

Deploy to your platform (Workers, Railway, etc.), set your webhook URL, and test from both a whitelisted and non-whitelisted account.

Ready to get your Telegram ID?

Get your numeric Telegram User ID in seconds. Free, instant, no setup.

Open Bot & Check My ID

Related Guides

View all FAQs on the main page