Skip to content

ngir0003/telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Telegram Bot for Movie & Series Updates

A Python-based Telegram bot that scrapes movie and series updates from websites like UFlix.to and posts them to a designated Telegram channel or group. The bot uses Markdown for formatted messages, encourages community engagement, and integrates with a local SQLite database and image directory for data management.


📂 Project Structure

project/
├── telegram_bot/
│   ├── bot.py           # Main bot script
│   ├── config.py        # Configuration and environment setup
│   ├── logger.py        # Logging setup
│   ├── .env             # Environment variables (not in version control)
│   └── logs/
│       └── bot.log      # Log file
└── webScraping/
    └── data/
        ├── database/
        │   └── movies_series.db  # SQLite database
        └── images/
            ├── movies/           # Movie images
            └── series/           # Series images

🌐 Repository

📦 GitHub: https://github.com/ngir0003/telegram_bot.git


🛠️ Prerequisites

To run this bot, ensure you have the following:

  • Python: Version 3.8 or higher
  • Dependencies:
    • python-dotenv: For handling .env files
    • requests: For making Telegram API calls
    • sqlite3: Built-in Python module for database operations
  • Telegram Bot: Created via BotFather with a valid bot token
  • Telegram Channel/Group: The bot must be an admin in the target channel or group
  • Database: A SQLite database (movies_series.db) with tables for movies and series
  • Images: Stored in webScraping/data/images/ (subfolders: movies/ and series/)

⚙️ Setup Instructions

1. Clone the Repository

git clone https://github.com/ngir0003/telegram_bot.git
cd telegram_bot

2. Set Up a Virtual Environment

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

Create a requirements.txt file with the following content:

python-dotenv
requests

Then install the dependencies:

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the telegram_bot/ directory with the following structure:

BOT_TOKEN=your_telegram_bot_token
CHANNEL_ID=@your_channel_id
TELEGRAM_GROUP_NIKI=your_telegram_group_url
TELEGRAM_CHANNEL_KINGPING=your_telegram_channel_url
WHATSAPP_GROUP=your_whatsapp_group_url
DATABASE_PATH=../webScraping/data/database/movies_series.db

⚠️ Important: Do not commit the .env file to version control. Ensure it is listed in .gitignore.

5. Run the Bot

python bot.py

The bot will start scraping updates, storing data in the SQLite database, and posting to the specified Telegram channel or group.


💬 Message Format

The bot posts updates in the following Markdown format:

🔥 Get Ready for More Awesome Content! 🔥

💥 Love what you see? Don’t keep it to yourself! 💥
📣 Share our groups with friends and join a growing community of movie & series lovers! 🎬💬

👥 Let’s Talk Stories! Join the chat, share your reviews, and discover hidden gems with fellow fans! 🌟

👇 Connect with us now! 👇
➡️ Telegram Group
➡️ Telegram Channel
➡️ WhatsApp Group

📜 Logging

The bot logs activities, errors, and status updates to telegram_bot/logs/bot.log. Logs include timestamps for easier debugging and monitoring.


🙌 Credits


📋 Additional Files

To complete your project setup, you may want to add:

  1. .gitignore:
    venv/
    *.pyc
    __pycache__/
    telegram_bot/.env
    telegram_bot/logs/
    webScraping/data/database/
    webScraping/data/images/

If you need assistance with generating other files like bot.py, config.py, logger.py, or the Apache License 2.0 text for the LICENSE file, please let me know!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages