🤖 ChatID Helper Bot
Effortlessly help you get your chat ID — simple and convenient. All the code is open-sourced on GitHub
ChatID Helper Bot
Effortlessly retrieve chat IDs with ease and convenience! This Telegram bot, built on Cloudflare Workers, requires no server deployment.
Example Bot: ChatIDHelperBot
https://github.com/CECEthanClarke/get-chatid-bot-cf-worker
Deployment Guide
Step 1: Create Your Telegram Bot
- Go to @BotFather on Telegram and use the
/newbotcommand to create your bot. - Follow the prompts to provide the required information.
- Once created, @BotFather will send you the bot’s token. This token is essential for deployment—save it for later use.
Step 2: Learn to Deploy Cloudflare Workers
- Refer to the Cloudflare Workers Deployment Guide.
- Download the bot’s source code.
- Run
npm run deploylocally to deploy your worker.
Step 3: Configure Required Environment Variables
To run the bot successfully, two environment variables must be set:
- BOT_TOKEN
- BOT_SECRET_TOKEN
Refer to the Cloudflare Workers documentation for adding environment variables.
Details:
- BOT_TOKEN: Copy and paste the token received from @BotFather into this variable.
- BOT_SECRET_TOKEN: This is a value you define yourself. It must meet the following criteria:
- 1-256 characters in length.
- Allowed characters:
A-Z,a-z,0-9,_, and-. - This ensures the bot’s security.
Step 4: Set the Webhook URL
Access the following API endpoint in your browser to configure the webhook URL:
https://api.telegram.org/bot<token>/setWebhook?url=<url>&secret_token=<BOT_SECRET_TOKEN>
Replace the placeholders <token>, <url>, and <BOT_SECRET_TOKEN> with your actual values:
<token>: Your bot’s token from @BotFather.<url>: The URL provided by Cloudflare after deploying your worker.<BOT_SECRET_TOKEN>: The value you defined in Step 3, ensuring it matches exactly.