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
index.htmlADVANCED_FEATURES.mdapp.cpython-313.pycREADME.md
index.html
Raw Download
Find: Go to:
<!--
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.
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Telegram Bot - RSK World</title>
    <meta name="description" content="Telegram bot with command handling and interactive features. Built by RSK World.">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        /* Fallback if external CSS fails */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background: #f0f2f5;
        }
    </style>
</head>

<body>

    <!-- Navigation -->
    <nav class="navbar">
        <div class="logo">
            <i class="fab fa-telegram text-info"></i> Telegram Bot
        </div>
        <div class="nav-links">
            <a href="#features">Features</a>
            <a href="#about">About</a>
            <a href="https://rskworld.in" target="_blank">RSK World</a>
            <a href="https://rskworld.in/contact.php" target="_blank" class="btn-primary">Contact Us</a>
        </div>
    </nav>

    <!-- Hero Section -->
    <header class="hero">
        <div class="hero-content">
            <h1>Advanced Telegram Bot Solution</h1>
            <p>A powerful, interactive Telegram bot with command handling, inline keyboards, and seamless file sharing.
                Perfect for your community or business.</p>
            <div class="cta-buttons">
                <a href="#" class="btn btn-primary">Start Bot</a>
                <a href="https://github.com/rskworld" target="_blank" class="btn btn-secondary">View Source</a>
            </div>
        </div>
        <div class="hero-image">
            <i class="fab fa-telegram"
                style="font-size: 200px; color: #fff; text-shadow: 0 10px 20px rgba(0,0,0,0.2);"></i>
        </div>
    </header>

    <!-- Features Section -->
    <section id="features" class="features">
        <h2 class="section-title">Key Features</h2>
        <div class="feature-grid">
            <div class="feature-card">
                <i class="fas fa-robot"></i>
                <h3>AI Assistant</h3>
                <p>Smart, context-aware AI conversations with the `/ai` command.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-stopwatch"></i>
                <h3>Task Reminders</h3>
                <p>Never miss a task. Set personal reminders with `/remind`.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-chart-pie"></i>
                <h3>Web Dashboard</h3>
                <p>Visualize your bot's growth and manage data via the PHP dashboard.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-microphone-alt"></i>
                <h3>AI Voice (TTS)</h3>
                <p>Convert text into realistic voice notes instantly using `/speak`.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-qrcode"></i>
                <h3>QR Code Generator</h3>
                <p>Generate QR codes instantly from text directly within the chat.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-chart-line"></i>
                <h3>Admin Dashboard</h3>
                <p>Track user statistics and broadcast messages to all users.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-database"></i>
                <h3>Persistent Database</h3>
                <p>Securely stores user data and feedback using SQLite.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-comments"></i>
                <h3>Feedback System</h3>
                <p>Collect structured feedback from your users effortlessly.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-terminal"></i>
                <h3>Command Handling</h3>
                <p>Robust parsing and handling of custom bot commands.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-keyboard"></i>
                <h3>Inline Keyboards</h3>
                <p>Interactive menus and buttons for better user engagement.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-file-upload"></i>
                <h3>File Sharing</h3>
                <p>Seamlessly upload and share documents and media.</p>
            </div>
            <div class="feature-card">
                <i class="fas fa-users"></i>
                <h3>Group Support</h3>
                <p>Works perfectly in both private chats and groups.</p>
            </div>
        </div>
    </section>

    <!-- Tech Stack -->
    <section class="tech-stack">
        <h2>Built With</h2>
        <div class="tech-icons">
            <span class="tech-tag">Python</span>
            <span class="tech-tag">Telegram API</span>
            <span class="tech-tag">python-telegram-bot</span>
            <span class="tech-tag">Node.js</span>
        </div>
    </section>

    <!-- Footer -->
    <footer>
        <div class="footer-content">
            <div class="footer-section">
                <h3>RSK World</h3>
                <p>Empowering developers with free resources and source code.</p>
                <div class="social-links">
                    <a href="#"><i class="fab fa-facebook"></i></a>
                    <a href="#"><i class="fab fa-twitter"></i></a>
                    <a href="#"><i class="fab fa-instagram"></i></a>
                </div>
            </div>
            <div class="footer-section">
                <h3>Contact</h3>
                <p>Email: hello@rskworld.in</p>
                <p>Phone: +91 93305 39277</p>
                <p>Address: Nutanhat, Mongolkote, Purba Burdwan, WB, India</p>
            </div>
        </div>
        <div class="copyright">
            <p>&copy; 2026 RSK World. All rights reserved. | Logic by Molla Samser | Design by Rima Khatun</p>
        </div>
    </footer>

    <script src="assets/js/script.js"></script>
</body>

</html>
168 lines•6.6 KB
markup
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.
🚀 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