A Next.js application that enables broadcasting messages to Telegram users through a bot. This dashboard allows for both individual and bulk messaging with rich formatting options.
-
Rich Text Formatting
- Bold text formatting
- Italic text formatting
- Code block formatting
- Support for Markdown syntax
-
Media Support
- Image sharing via URL
- Preview of attached media
-
Interactive Elements
- Up to 3 custom inline buttons
- Configurable button text and URLs
-
Multiple Input Methods
- Manual input of Telegram user IDs (comma-separated)
- Bulk import via CSV file
- Real-time user list preview
- User count display
-
CSV Format Support
- Simple one-ID-per-line format
- Supports both .csv and .txt files
- Automatic filtering of empty lines
- Efficient Message Delivery
- Batch processing of messages
- Rate limiting to prevent API throttling
- Success/failure tracking for each message
- Detailed delivery status reporting
- Frontend Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS with shadcn/ui components
- Language: TypeScript
- Font: Geist Font (Sans & Mono)
- Node.js 18.17 or later
- A Telegram Bot Token
- Basic knowledge of Telegram Bot API
- Clone the repository:
git clone [repository-url]
cd telegram-broadcast-dashboard
- Install dependencies:
npm install
- Set up environment variables:
Create a
.env.local
file in the root directory:
TELEGRAM_BOT_TOKEN=your_bot_token_here
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
- Create a new bot using @BotFather
- Obtain the bot token
- Add the token to your environment variables
Users must have interacted with your bot before you can send them messages. To get user IDs:
- Users should start a chat with your bot
- Store user IDs when they interact with your bot
- Export IDs in CSV format for bulk messaging
-
Add Recipients
- Use the "Manual Input" tab for individual or small groups
- Use "CSV Upload" for bulk recipients
- Verify the user count before sending
-
Compose Message
- Enter your message text
- Use formatting buttons or Markdown syntax
- Add image URL if needed
- Configure inline buttons if required
-
Send Broadcast
- Click "Send Broadcast"
- Monitor the status for delivery results
- Check failed deliveries in the response
*bold text*
_italic text_
`code block`
123456789
987654321
567891234
The application handles various error scenarios:
- Invalid user IDs
- Network failures
- API rate limits
- Undeliverable messages
Failed deliveries are logged with specific error messages for troubleshooting.
├── app/
│ ├── api/
│ │ └── broadcast/
│ │ ├── route.ts
│ │ └── types.ts
│ ├── fonts/
│ ├── types/
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── components/
│ └── ui/
├── public/
├── .env.local
└── package.json
The application uses shadcn/ui components:
- Card
- Button
- Textarea
- Alert
- Tabs
- Input
- Fork the repository
- Create a feature branch:
git checkout -b feature/feature-name
- Commit changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/feature-name
- Submit a Pull Request
For support, issues, or feature requests, please create an issue in the GitHub repository.
[yaantow]