Get free virtual phone numbers β’ View SMS inboxes β’ Browse countries
π€ Live Bot Demo: @ARTempnumBot
Built with β€οΈ by Ashlynn Repository
The bot is packed with powerful features designed for a premium user experience and seamless serverless hosting:
- π Global Country Browser: Browse and pick from dozens of available countries (such as USA, UK, Germany, Russia, Spain, India, and more).
- π’ Random Number Retrieval: Fetch an active virtual phone number instantly from random pools with one tap.
- π₯ Real-Time SMS Inbox: View the last 5 messages received on any active number. Messages refresh each time you check, allowing you to easily read verification OTPs.
- π Instant Number Renewal: Get a different active virtual number immediately if your current number is busy or inactive.
- π Telegram Profile Check: Includes deep links to directly search the number on Telegram to verify if a profile already exists.
- π¨ Modern Interface: Clean and professional messages utilizing HTML formatting, flags, and custom styled interactive inline buttons.
- π Serverless Cloudflare Worker: Built to run entirely on Cloudflare Workers (V8 runtime), ensuring ultra-fast edge routing, zero maintenance, and free tier compatibility.
- π Force Join Gate: Built-in channel membership validation (via @Ashlynn_Repository) to grow your community. The bot checks membership before granting access to commands.
- π Secure Webhook Handler: Protected by secret webhook tokens (
X-Telegram-Bot-Api-Secret-Token) to prevent spoofing and ensure that only updates from Telegram are processed. - π Single-File Logic: Clean, optimized codebase inside
src/index.jsfor easier deployment and performance optimization. - π OnlineSIM.io Integration: Powered by free public API endpoints from OnlineSIM.io for retrieving real-time active numbers and inboxes.
The bot supports standard commands as well as interactive inline callbacks:
| Command | Action / Description |
|---|---|
/start |
Launches the bot, checks channel join, and shows the main interactive menu |
/number |
Directly fetches a random active virtual number with check/renew options |
/countries |
Opens a paginated catalog to browse and choose specific countries |
/help |
Displays a detailed usage manual and tips |
/about |
Shows bot software details, version, and developer credits |
Follow these instructions to deploy your own instance of the Virtual Number Bot to Cloudflare Workers on Windows, macOS, or Linux.
- Telegram Bot Token: Get a bot token from @BotFather on Telegram.
- Cloudflare Account: Sign up for a free account at Cloudflare.
- Node.js: Install Node.js (v18+) for your operating system.
Choose the guide for your operating system to set up Node.js and dependencies:
- Install Node.js: Download and run the installer from the Node.js Official Page, or use winget:
winget install OpenJS.NodeJS
- Install Dependencies: Open your terminal (PowerShell or CMD) in the project root directory and run:
npm install
- Install Node.js: Install via Homebrew:
brew install node
- Install Dependencies: Open Terminal in the project root directory and run:
npm install
- Install Node.js: Install via your package manager (e.g. Debian/Ubuntu):
sudo apt update sudo apt install -y nodejs npm
- Install Dependencies: Open terminal in the project root directory and run:
npm install
Once dependencies are installed, follow these steps to deploy to Cloudflare:
Run the wrangler login command to authorize your machine:
npx wrangler loginThis will open a browser window. Click "Allow" to log in with your Cloudflare credentials.
Wrangler securely uploads your credentials directly to Cloudflare's environment vaults.
Set your Telegram Bot Token:
npx wrangler secret put BOT_TOKENWhen prompted, paste your Telegram Bot Token (e.g. 123456789:ABCDefghIjklmNoPQRsTuvWxYz).
Set a Webhook Secret Token (Choose a random string to secure your webhook endpoint):
npx wrangler secret put WEBHOOK_SECRETWhen prompted, paste your custom secret token (e.g. MySuperSecretToken123).
Deploy the script to the Cloudflare Edge network:
npx wrangler deployOnce complete, wrangler will print the deployed URL. For example:
Published ar-virtualnum-bot (4.12 sec)
https://ar-virtualnum-bot.<your-subdomain>.workers.dev
To tell Telegram to send updates to your newly deployed Cloudflare Worker, visit the setup page in your web browser:
https://<your-worker-url>.workers.dev/setup
(Replace <your-worker-url> with the URL from the deployment step above).
If successful, you will see a JSON response confirming registration:
{
"action": "Webhook setup",
"webhookUrl": "https://ar-virtualnum-bot.your-subdomain.workers.dev/webhook",
"result": {
"ok": true,
"result": true,
"description": "Webhook was set"
}
}To require users to join your Telegram channel before using the bot:
- Open src/index.js and update the
FORCE_JOIN_CHANNELandFORCE_JOIN_LINKconstants to your channel username and join link:const FORCE_JOIN_CHANNEL = "YourChannelUsername"; // Channel username without @ const FORCE_JOIN_LINK = "https://t.me/YourChannelUsername";
- Add your Bot as an Administrator in your Telegram channel with at least the Invite Users via Link (or Read Members) permission.
- Redeploy your changes by running
npx wrangler deploy.
Your deployed worker hosts the following endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/ |
GET |
Health Check (shows status, bot name, and version) |
/setup |
GET |
Registers the Telegram Webhook using configured secrets |
/remove |
GET |
Deregisters and deletes the Webhook from Telegram |
/webhook |
POST |
Processes incoming updates from Telegram (validated via WEBHOOK_SECRET) |
You can run the worker locally to debug code changes:
npm run devWarning
Local worker instances cannot receive webhook events directly from Telegram since localhost is private. To test webhook updates locally, use a tunneling tool such as ngrok or cloudflared to expose your local port (default is 8787), configure it as your webhook URL on Telegram, or mock updates manually.
ββββββββββββ ββββββββββββ ββββββββββββββ ββββββββββββββββ
β Telegram β ββ(1)ββ>β Worker β ββ(2)ββ>β ForceJoin? β ββ(3)ββ>β OnlineSIM β
β User β β /webhook β β Verificationβ β APIs β
ββββββββββββ ββββββββββββ ββββββββββββββ ββββββββββββββββ
β² β β β
β β βΌ β
βββββββββ(6)ββββββββββ΄ββββββββββ(5)ββββββββββ΄ββββββββββ(4)ββββββββββ
Responsive HTML payload sent back to Telegram
- User interaction: User clicks a button or types a command in Telegram.
- Webhook execution: Telegram sends a POST request with the update to the Cloudflare Worker
/webhook. - Authentication: The Worker verifies the header token, routes the update, and checks if the user is in the channel.
- Data retrieval: If verified, the Worker queries OnlineSIM free APIs to gather active countries, numbers, or inbox messages.
- Payload processing: The response is processed, HTML-formatted, and keyboard layouts are generated.
- Delivery: The Worker uses the Telegram Bot API to send/edit the message to the user.
.
βββ src/
β βββ index.js # All Bot routing and handler logic
βββ package.json # Node package configuration
βββ package-lock.json # Locked dependency versions
βββ wrangler.toml # Cloudflare Workers configuration
βββ README.md # Project documentation (You are here)
π’ Ashlynn Repository
Star β this repo if you found it useful!