- Project Overview
- Features
- Technical Requirements
- Setup Instructions
- Commands
- Deployment Options
- Contributing
- License
- Contact
The Telegram Movie Request Bot is a user-friendly bot designed to help users request movies easily within Telegram groups. It automatically forwards movies from a private channel to authorized groups based on user requests. The bot includes a database for managing movie entries and provides a streamlined experience for both users and admins.
- 🎥 Automatic Movie Forwarding: Instantly forward requested movies from a private channel.
- 📝 Admin Management: Multiple admin support for managing the movie database.
- 🔍 Movie Search: Search for movies by title and year.
- 📩 Message ID-Based Storage: Store movies using their Telegram message IDs.
- 📊 SQLite / PostgreSQL Database Integration: Use SQLite by default, with an option to connect to PostgreSQL for larger datasets.
To run this bot, ensure you have the following set up:
- Python: Version 3.10 or higher
- Telegram API Access: Obtain a bot token from BotFather
- Admin Privileges: Admin access in both the group and the private channel
- Required Packages:
python-telegram-botpeeweepython-dotenvpsycopg2-binary(optional, for PostgreSQL support)
Simple Setup [For pro Guy's only 😁]
A minimal set-up instructions for pro Guy's.
- Connect Your VPS:
- Clone Repository
- Install Requirements
- Fill .env with your actual credentials
- Screen -S Flick (For Running all time)
- python main.py
Local Set-up
Follow these steps to set up the bot on your local machine:
-
Clone the Repository:
git clone https://github.com/ReOneSec/FlickFusion.git cd FlickFusion -
Create a Virtual Environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies: Create a
requirements.txtfile with the following contents:python-telegram-bot==20.3 peewee==3.16.0 python-dotenv==1.0.0 psycopg2-binary==2.9.6 # Optional, for PostgreSQL supportThen install the dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile in the project root with the following content:BOT_TOKEN=your_bot_token ADMIN_ID=your_user_id,another_admin_id # Comma-separated for multiple admins CHANNEL_ID=your_channel_id AUTH_GRP=authorised_group_id,another_group_id # Comma-separated for multiple groups DATABASE_URL=sql-databases.url # Optional, defaults to local SQLite
-
Initialize the Database: Run the following command to create the database and tables:
python main.py
Deploy on VPS [Ubuntu/Debian]
Follow these steps to set up the bot on an Ubuntu VPS:
-
Connect to Your VPS:
ssh username@your_vps_ip
-
Update System and Install Dependencies:
sudo apt update sudo apt upgrade -y sudo apt install -y python3 python3-pip python3-venv git
-
Clone the Repository:
git clone https://github.com/yourusername/telegram-movie-bot.git cd telegram-movie-bot -
Create a Virtual Environment:
python3 -m venv venv source venv/bin/activate -
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
nano .env
Add the following content:
BOT_TOKEN=your_bot_token ADMIN_ID=your_user_id,another_admin_id CHANNEL_ID=your_channel_id AUTH_GRP=authorised_group_id,another_group_id DATABASE_URL=sql-databases.url # Optional
-
Run the Bot:
python3 main.py
-
Setup as a System Service (Recommended):
sudo nano /etc/systemd/system/moviebot.service
Add the following content:
[Unit] Description=Telegram Movie Request Bot After=network.target [Service] User=your_username WorkingDirectory=/path/to/telegram-movie-bot ExecStart=/path/to/telegram-movie-bot/venv/bin/python3 main.py Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable moviebot sudo systemctl start moviebot -
Check Service Status:
sudo systemctl status moviebot
Deploy in Termux
Follow these steps to run the bot on your Android device using Termux:
-
Install Termux from F-Droid (recommended) or Google Play Store.
-
Update Termux and Install Dependencies:
pkg update pkg upgrade -y pkg install -y python git
-
Clone the Repository:
git clone https://github.com/yourusername/telegram-movie-bot.git cd telegram-movie-bot -
Set Up Python Environment:
pip install --upgrade pip pip install -r requirements.txt
-
Configure Environment Variables:
nano .env
Add the following content:
BOT_TOKEN=your_bot_token ADMIN_ID=your_user_id,another_admin_id CHANNEL_ID=your_channel_id AUTH_GRP=authorised_group_id,another_group_id DATABASE_URL=movies.db # Use SQLite for Termux
-
Run the Bot:
python main.py
-
Keep the Bot Running in Background:
# Run the bot with nohup nohup python main.py > bot.log 2>&1 &
-
Managing the Bot: To check if the bot is running:
ps aux | grep pythonTo view log output:
cat bot.log
To stop the bot:
pkill -f "python main.py"
/start: Get a welcome message and usage instructions./help: Display a list of available commands./search <Movie Name>: Check Availability of a movie by title (e.g.,/search Inception)./get <Movie Name>: Get This Movie./get: To Get Any Random Movie.
/addmovie <title>: Add a new movie to the database./listmovies: List all available movies in the database./deletemovie <id>: Delete a movie by its ID./cancel: To cancel any Ongoing Process.
Running as a Background Service
Running as a Background Service
Screen is a simple tool that allows you to run processes in the background and reattach to them later.
# Install screen
sudo apt install screen # Ubuntu/Debian
pkg install screen # Termux
# Start a new screen session
screen -S moviebot
# Run your bot
python main.py
# Detach from screen (press Ctrl+A, then D)To reattach to the screen session:
screen -r moviebotUsing Docker
Using Docker
If you prefer using Docker for deployment:
-
Create a Dockerfile:
nano Dockerfile
Add the following content:
FROM python:3.10-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD ["python", "main.py"]
-
Build and Run the Docker Container:
docker build -t movie-request-bot . docker run -d --name moviebot --restart always --env-file .env movie-request-bot -
Check Container Logs:
docker logs -f moviebot
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/YourFeature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/YourFeature - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or support, feel free to reach out:
- Name: ViperROX
- Email: [email protected]
- Telegram: @ViperROX
Thank you for using the Telegram Movie Request Bot! Enjoy exploring the world of cinema with FlickFusion! 🎬🍿