π·πΊ Π ΡΡΡΠΊΠΈΠΉ | π©πͺ Deutsch | π«π· FranΓ§ais | πͺπΈ EspaΓ±ol | π΅πΉ PortuguΓͺs | πΈπ¦ Ψ§ΩΨΉΨ±Ψ¨ΩΨ© | π―π΅ ζ₯ζ¬θͺ | π°π· νκ΅μ΄ | πΉπ ΰΉΰΈΰΈ’ | π¨π³ δΈζ
This project generates SVG badges with the current member count of your Telegram groups and channels. Perfect for displaying community activity in GitHub README files or on websites.
Supports both:
- π₯ Telegram Groups - Interactive communities where all members can send messages
- π’ Telegram Channels - Broadcast channels where only admins can post messages
Both groups and channels use the same API endpoint and work identically with this badge generator.
Just use URL parameters to generate badges for any Telegram group or channel:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel_or_group
- Node.js / TypeScript
- Telegram Bot API
- Vercel (Serverless API)
- Jest for testing
- Biome for linting and formatting
Simply add your Telegram group or channel ID to the URL:

Works with:
- Public channels:
@your_channel
- Public groups:
@your_group
- Private groups/channels:
-1001234567890
(numeric chat ID)
That's it! No deployment, no bot token needed for public groups and channels.
For advanced users who want to host their own instance:
- Telegram Bot Token (create via @BotFather)
- Vercel account (or any Node.js hosting)
Set environment variables:
BOT_TOKEN
: Your Telegram bot tokenCHAT_ID
: Default chat ID (optional if using URL parameters)
git clone https://github.com/chatman-media/telegram-badge.git
cd telegram-badge
npm install
# Create .env file
echo "BOT_TOKEN=your_bot_token" > .env
echo "CHAT_ID=@your_channel" >> .env
npm run dev
You can customize the badge appearance using the following parameters:
Parameter | Description | Default Value |
---|---|---|
channelId |
Telegram chat ID or username (e.g., @your_channel ) |
From environment |
style |
Badge style | flat |
label |
Label text | Telegram |
color |
Main badge color | 2AABEE (Telegram color) |
labelColor |
Label color | 555555 |
logo |
Show Telegram logo | true |
flat
- flat style (default)plastic
- plastic style with gradientflat-square
- flat square style without rounded cornersfor-the-badge
- wide style with uppercase letterssocial
- GitHub social style
Standard badge (flat style):
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel
Badge with plastic style:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=plastic
Badge with flat-square style:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=flat-square
Badge with for-the-badge style:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=for-the-badge
Badge with social style:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=social
Badge with custom label and color:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&label=Join%20Chat&color=00FF00
Fully customized badge:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=for-the-badge&label=Community&color=FF5733&labelColor=1A1A1A
Badge without logo:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&logo=false
Badge for specific channel:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel
Badge with custom styling:
https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=for-the-badge&color=FF5733
- π₯ Real-time member count display
- π Direct URL parameters - no setup required!
- π¨ Full badge appearance customization
- π Optional self-hosting with secure token storage
- β‘ Optimized caching for fast loading
- π‘οΈ Error handling with informative messages
- π Free to use
- π‘ Can be extended to show activity/message count
- π§ͺ Comprehensive test suite with TypeScript
npm install telegram-badge
import badgeHandler from "telegram-badge";
// Use in your serverless function
export default badgeHandler;
# Using JSR
deno add @chatman-media/telegram-badge
# Or import directly
import badgeHandler from "jsr:@chatman-media/telegram-badge";
import badgeHandler from "@chatman-media/telegram-badge";
// Use in your Deno serverless function
export default badgeHandler;
GET /api/telegram-badge?channelId=@your_channel&style=flat&label=Members&color=2AABEE&labelColor=555555
Run the test suite:
npm test
Run type checking:
npm run type-check
Build the project:
npm run build
Telegram Groups:
- π₯ Interactive communities where all members can send messages
- Members can see each other and interact
- Can have up to 200,000 members
- Example:
@your_group
Telegram Channels:
- π’ Broadcast channels where only admins can post messages
- Subscribers cannot see each other
- Can have unlimited subscribers
- Example:
@your_channel
For this badge generator: Both groups and channels work exactly the same way! The Telegram Bot API treats them identically for getting member/subscriber counts.
For public groups/channels:
- Use the username:
@your_channel
or@your_group
For private groups/channels:
- Use a bot like @userinfobot
- Forward any message from your group/channel to the bot
- It will show the chat ID (like
-1001234567890
)
No bot token needed for public groups and channels when using the hosted service at telegram-badge.vercel.app
.
Bot token required only for:
- Private groups/channels
- Self-hosted deployments
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
|
- BTC: 14s9Y9Rb2CUWHSAatiQMhfkpx1MWXofUzw
- TON: UQBx7Sgtn5q_PzwUAjvnA_lj9CQx1NhN9JDi3abOgpRYnAnr
- NOT: UQBx7Sgtn5q_PzwUAjvnA_lj9CQx1NhN9JDi3abOgpRYnAnr
- ETH: 0x286D65151b622dCC16624cEd8463FDa45585fd60
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Chatman Media