Skip to content

πŸ›‘οΈ Telegram Group Badge Generator - generates SVG badges with the current member count of your Telegram group.

License

Notifications You must be signed in to change notification settings

chatman-media/telegram-badge

Repository files navigation

πŸ›‘οΈ Telegram Group Badge Generator

πŸ‡·πŸ‡Ί Русский | πŸ‡ΊπŸ‡Έ English | πŸ‡¨πŸ‡³ δΈ­ζ–‡

Build Status npm version npm bundle size TypeScript License: MIT

GitHub stars dev.to X (Twitter)

This project generates SVG badges with the current member count of your Telegram group. Perfect for displaying community activity in GitHub README files or on websites.

πŸš€ Quick Start

Just use URL parameters to generate badges for any Telegram channel or group:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel

Telegram Group Members


πŸ“¦ Tech Stack

  • Node.js / TypeScript
  • Telegram Bot API
  • Vercel (Serverless API)
  • Jest for testing

🧩 Usage

Primary Method: URL Parameters (No Setup Required!)

Simply add your Telegram channel/group ID to the URL:

![Telegram Badge](https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel)

That's it! No deployment, no bot token needed.

Alternative Method: Self-Hosted Deployment

For advanced users who want to host their own instance:

1. Prerequisites

  • Telegram Bot Token (create via @BotFather)
  • Vercel account (or any Node.js hosting)

2. Deploy to Vercel

Deploy with Vercel

Set environment variables:

  • BOT_TOKEN: Your Telegram bot token
  • CHAT_ID: Default chat ID (optional if using URL parameters)

3. Local Development

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

🎨 Styling Parameters

You can customize the badge appearance using the following parameters:

Parameter Description Default Value
channelId Telegram chat ID or username (e.g., ``) 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

Available styles:

  • flat - flat style (default)
  • plastic - plastic style with gradient
  • flat-square - flat square style without rounded corners
  • for-the-badge - wide style with uppercase letters
  • social - GitHub social style

Examples:

Standard badge (flat style):

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel

Flat

Badge with plastic style:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=plastic

Plastic

Badge with flat-square style:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=flat-square

Flat-Square

Badge with for-the-badge style:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=for-the-badge

For-The-Badge

Badge with social style:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=social

Social

Badge with custom label and color:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&label=Join%20Chat&color=00FF00

Custom

Fully customized badge:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&style=for-the-badge&label=Community&color=FF5733&labelColor=1A1A1A

Full Custom

Badge without logo:

https://telegram-badge.vercel.app/api/telegram-badge?channelId=@your_channel&logo=false

No Logo

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

✨ Features

  • πŸ‘₯ 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

πŸ”§ API Usage

As npm package:

npm install telegram-badge
import badgeHandler from 'telegram-badge';

// Use in your serverless function
export default badgeHandler;

Direct API calls:

GET /api/telegram-badge?style=flat&label=Members&color=2AABEE&labelColor=555555

πŸ§ͺ Testing

Run the test suite:

npm test

Run type checking:

npm run type-check

Build the project:

npm run build

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Subscribe

TikTok twitch YouTube Telegram X

Support πŸ’πŸš€

  • BTC: 14s9Y9Rb2CUWHSAatiQMhfkpx1MWXofUzw
  • TON: UQD1M80nPyzph5ZW1vfp_r19XI5MaerNhDq4dWXbXCo96WFj
  • NOT: UQD1M80nPyzph5ZW1vfp_r19XI5MaerNhDq4dWXbXCo96WFj
  • ETH: 0x286D65151b622dCC16624cEd8463FDa45585fd60
BTC TON NOT ETH

Star History

Star History Chart

Repo Activity

Alt

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❀️ by Chatman Media

About

πŸ›‘οΈ Telegram Group Badge Generator - generates SVG badges with the current member count of your Telegram group.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •