help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
telegram-bot
RSK World
telegram-bot
Telegram Bot - Python + Telegram Bot API + SQLite + PHP Dashboard + Bot Commands + Automation
telegram-bot
  • __pycache__
  • assets
  • .env1.5 KB
  • .gitignore845 B
  • CHANGELOG.md3.8 KB
  • LICENSE1.3 KB
  • LICENSE.txt1.3 KB
  • PROJECT_STATUS.md3.2 KB
  • README.md6.7 KB
  • RELEASE_NOTES.md5.5 KB
  • SETUP.md1.5 KB
  • bot.db0 B
  • bot.py3.9 KB
  • config.py773 B
  • dashboard.php8.1 KB
  • database.py7.5 KB
  • handlers.py19.5 KB
  • index.html6.6 KB
  • project_info.php1.5 KB
  • requirements.txt564 B
  • setup.py3.1 KB
  • utils.py8.9 KB
chatbot.pyvalidate_project.pylanguage_detection.pyapp.cpython-313.pycREADME.mdconfig.cpython-313.pycRELEASE_NOTES.md
README.md
Raw Download

README.md


<!--
Project: Telegram Bot
Author: Molla Samser
Designer & Tester: Rima Khatun
Website: https://rskworld.in
Contact: hello@rskworld.in | +91 93305 39277
Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
Copyright: © 2026 RSK World. All rights reserved.
-->

# Telegram Bot - RSK World

**Category:** Custom Chatbots
**Difficulty:** Beginner
**Year:** 2026

## Overview
This project creates a robust Telegram bot with command handling, inline keyboards, and interactive features. It is designed to be a starting point for building complex Telegram automation tools.

## Features

### Core Features
- **Command Handling**: Easily parse and respond to user commands like `/start` and `/help`.
- **Inline Keyboards**: Interactive buttons and menus for enhanced user experience.
- **File Sharing**: Capabilities to handle file uploads and downloads.
- **Group Chat Support**: Functionality tailored for both private and group interactions.
- **Web Landing Page**: A beautiful, responsive landing page to showcase your bot.
- **Admin Dashboard**: PHP-based dashboard to monitor bot statistics and user data.

### Utility Features
- **QR Code Generator**: Generate QR codes from any text (`/qr`)
- **Text to Speech**: Convert text to voice notes (`/speak`)
- **PDF Creator**: Create PDF documents from text (`/pdf`)
- **Language Translator**: Translate text to multiple languages (`/translate`)
- **Weather Info**: Get weather information for any city (`/weather`)

### Advanced Features
- **AI Assistant**: Intelligent responses using OpenAI API or rule-based system (`/ai`)
- **Task Reminders**: Set personal reminders (`/remind`)
- **Password Generator**: Generate secure random passwords (`/password`)
- **URL Shortener**: Shorten long URLs (`/shorten`)
- **Calculator**: Perform mathematical calculations (`/calc`)
- **Unit Converter**: Convert between different units (`/convert`)
- **News Fetcher**: Get latest news articles (`/news`)
- **Text Summarizer**: Summarize long text (`/summarize`)
- **User Leaderboard**: View top users by XP (`/leaderboard`)
- **XP & Leveling System**: Users earn XP and level up by using the bot
- **User Profiles**: View detailed user statistics (`/profile`)

### Admin Features
- **Statistics Dashboard**: View comprehensive bot statistics (`/stats`)
- **Broadcast Messages**: Send messages to all users (`/broadcast`)
- **Database Export**: Export bot database (`/export`)
- **Web Dashboard**: Monitor users, feedback, and statistics via PHP dashboard

## Technologies Used
- **Telegram API** (python-telegram-bot library)
- **Python 3.8+** (Core bot logic)
- **SQLite** (Database for user data, feedback, reminders)
- **PHP** (Admin dashboard)
- **HTML5 & CSS3** (Landing page and dashboard UI)
- **JavaScript** (Frontend interactions)
- **OpenAI API** (Optional - for advanced AI features)
- **OpenWeatherMap API** (Optional - for real weather data)

## Getting Started

### Prerequisites
- Python 3.8+
- A Telegram Bot Token (Get one from [@BotFather](https://t.me/BotFather))

### Installation

1. **Clone or Download** the project.
2. **Install Dependencies**:
```bash
pip install -r requirements.txt
```
3. **Configuration**:
- Create a `.env` file in the project root (or copy from `.env.example` if available).
- Set the following variables:
```
TELEGRAM_BOT_TOKEN=your_bot_token_here
ADMIN_ID=your_telegram_user_id
```
- Optional: Add API keys for enhanced features:
```
OPENAI_API_KEY=your_openai_key (for AI features)
OPENWEATHER_API_KEY=your_weather_key (for real weather data)
```

### Running the Bot
```bash
python bot.py
```
The bot will start polling for updates. Logs will be saved to `bot.log`.

### Available Commands
- `/start` - Start the bot
- `/help` - Show all available commands
- `/features` - List all bot features
- `/profile` - View your profile and statistics
- `/leaderboard` - View top users
- `/qr <text>` - Generate QR code
- `/speak <text>` - Convert text to speech
- `/translate <lang> <text>` - Translate text
- `/pdf <text>` - Create PDF from text
- `/weather <city>` - Get weather info
- `/ai <question>` - Ask AI assistant
- `/remind <minutes> <message>` - Set reminder
- `/password [length]` - Generate password
- `/shorten <url>` - Shorten URL
- `/calc <expression>` - Calculator
- `/convert <value> <from> <to>` - Unit converter
- `/news [topic]` - Get news
- `/summarize <text>` - Summarize text
- `/feedback` - Send feedback
- `/stats` - Bot statistics (Admin only)
- `/broadcast <message>` - Broadcast message (Admin only)
- `/export` - Export database (Admin only)

### Web Dashboard
To view the admin dashboard:
1. Ensure PHP is installed and configured
2. Place the project in your web server directory
3. Access `dashboard.php` via your web browser
4. The dashboard shows user statistics, feedback, and leaderboard

### Web Landing Page
To view the project landing page, simply open `index.html` in your browser or serve it using a local server:
```bash
# Python simple server example
python -m http.server 8000
```
Then navigate to `http://localhost:8000`.

## Project Structure
```
telegram-bot/
├── bot.py # Main bot file
├── config.py # Configuration settings
├── handlers.py # Command handlers
├── database.py # Database operations
├── utils.py # Utility functions
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore file
├── dashboard.php # Admin dashboard
├── index.html # Landing page
├── project_info.php # Project metadata
└── assets/
├── css/
│ └── style.css
└── js/
└── script.js
```

## Recent Updates
- ✅ Enhanced error handling throughout the codebase
- ✅ Added comprehensive logging system
- ✅ Improved PDF generation with better Unicode support
- ✅ Added OpenAI integration for AI features
- ✅ Added OpenWeatherMap integration for real weather data
- ✅ Implemented user leaderboard and XP system
- ✅ Added multiple utility commands (password, URL shortener, calculator, etc.)
- ✅ Enhanced admin dashboard with more statistics
- ✅ Added file upload/download handling
- ✅ Improved database error handling
- ✅ Added .gitignore for better version control

## Contact & Credits
**Author:** Molla Samser
**Designer & Tester:** Rima Khatun
**Website:** [RSK World](https://rskworld.in)
**Contact:** [hello@rskworld.in](mailto:hello@rskworld.in)
**Address:** Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India

© 2026 RSK World. All rights reserved.
config.cpython-313.pyc

This file cannot be displayed in the browser.

Download File
RELEASE_NOTES.md
Raw Download

RELEASE_NOTES.md

# Release Notes - Telegram Bot v2.0.0

## 🎉 Initial Release - Advanced Telegram Bot

**Release Date:** January 2026
**Version:** 2.0.0
**Repository:** [https://github.com/rskworld/telegram-bot](https://github.com/rskworld/telegram-bot)

---

## 📋 Overview

This is the initial release of the Advanced Telegram Bot - a comprehensive, feature-rich Telegram bot built with Python. The bot includes 20+ commands, admin dashboard, user analytics, and much more.

---

## ✨ Features

### Core Utility Features
- ✅ **QR Code Generator** - Generate QR codes from any text
- ✅ **Text-to-Speech** - Convert text to voice notes
- ✅ **PDF Creator** - Create PDF documents from text
- ✅ **Language Translator** - Translate text to multiple languages
- ✅ **Weather Info** - Get weather information for any city
- ✅ **Text Summarizer** - Summarize long text

### Advanced Features
- ✅ **AI Assistant** - Intelligent responses (OpenAI integration optional)
- ✅ **Task Reminders** - Set personal reminders
- ✅ **Password Generator** - Generate secure random passwords
- ✅ **URL Shortener** - Shorten long URLs
- ✅ **Calculator** - Perform mathematical calculations
- ✅ **Unit Converter** - Convert between different units (km/miles, kg/lbs, temperature, etc.)
- ✅ **News Fetcher** - Get latest news articles

### User Features
- ✅ **User Profiles** - View detailed user statistics
- ✅ **Leaderboard** - Top users by XP
- ✅ **XP & Leveling System** - Earn XP and level up
- ✅ **Gamification** - Achievement system

### Admin Features
- ✅ **Statistics Dashboard** - Comprehensive bot analytics
- ✅ **Broadcast Messages** - Send messages to all users
- ✅ **Database Export** - Export bot database
- ✅ **Web Dashboard** - PHP-based admin interface

### Technical Features
- ✅ **SQLite Database** - Persistent data storage
- ✅ **Error Handling** - Comprehensive error management
- ✅ **Logging System** - File-based logging
- ✅ **File Upload Handling** - Process documents and photos
- ✅ **Feedback System** - Collect user feedback

---

## 🛠️ Technologies

- **Python 3.8+** - Core bot logic
- **python-telegram-bot 20.7** - Telegram API wrapper
- **SQLite** - Database
- **PHP** - Admin dashboard
- **HTML5/CSS3/JavaScript** - Web interface
- **OpenAI API** (Optional) - Advanced AI features
- **OpenWeatherMap API** (Optional) - Real weather data

---

## 📦 Installation

1. **Clone the repository:**
```bash
git clone https://github.com/rskworld/telegram-bot.git
cd telegram-bot
```

2. **Install dependencies:**
```bash
pip install -r requirements.txt
```

3. **Configure environment:**
- Create `.env` file
- Add your `TELEGRAM_BOT_TOKEN`
- Add your `ADMIN_ID`

4. **Run the bot:**
```bash
python bot.py
```

For detailed setup instructions, see [SETUP.md](SETUP.md)

---

## 📚 Documentation

- **[README.md](README.md)** - Complete project documentation
- **[SETUP.md](SETUP.md)** - Setup and installation guide
- **[CHANGELOG.md](CHANGELOG.md)** - Version history and changes
- **[PROJECT_STATUS.md](PROJECT_STATUS.md)** - Project status and verification

---

## 🎯 Available Commands

### Basic Commands
- `/start` - Start the bot
- `/help` - Show all commands
- `/features` - List bot features
- `/contact` - Contact information
- `/profile` - View your profile
- `/leaderboard` - View top users
- `/feedback` - Send feedback

### Utility Commands
- `/qr <text>` - Generate QR code
- `/speak <text>` - Convert text to speech
- `/translate <lang> <text>` - Translate text
- `/pdf <text>` - Create PDF
- `/weather <city>` - Get weather
- `/summarize <text>` - Summarize text

### Advanced Commands
- `/ai <question>` - Ask AI assistant
- `/remind <minutes> <message>` - Set reminder
- `/password [length]` - Generate password
- `/shorten <url>` - Shorten URL
- `/calc <expression>` - Calculator
- `/convert <value> <from> <to>` - Unit converter
- `/news [topic]` - Get news

### Admin Commands
- `/stats` - Bot statistics (Admin only)
- `/broadcast <message>` - Broadcast message (Admin only)
- `/export` - Export database (Admin only)

---

## 🔧 Configuration

### Required
- `TELEGRAM_BOT_TOKEN` - Your bot token from @BotFather
- `ADMIN_ID` - Your Telegram user ID

### Optional
- `OPENAI_API_KEY` - For advanced AI features
- `OPENWEATHER_API_KEY` - For real weather data
- `WEBHOOK_URL` - For production deployment
- `PORT` - Webhook port

---

## 📊 Project Statistics

- **Total Files:** 19
- **Lines of Code:** 2,500+
- **Commands:** 20+
- **Features:** 30+
- **Documentation:** Complete

---

## 👥 Credits

**Author:** Molla Samser
**Designer & Tester:** Rima Khatun
**Organization:** RSK World
**Website:** [https://rskworld.in](https://rskworld.in)
**Contact:** hello@rskworld.in | +91 93305 39277

---

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## 🔗 Links

- **Repository:** [https://github.com/rskworld/telegram-bot](https://github.com/rskworld/telegram-bot)
- **Website:** [https://rskworld.in](https://rskworld.in)
- **Issues:** [https://github.com/rskworld/telegram-bot/issues](https://github.com/rskworld/telegram-bot/issues)

---

## 🚀 What's Next?

- Enhanced AI capabilities
- More utility commands
- Improved dashboard features
- Mobile app integration
- Multi-language support

---

**© 2026 RSK World. All rights reserved.**

🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer