This Telegram bot allows users to:
- Get anime information with the
/anime <name>command - Download doujins as PDFs with the
/get_doujin <URL>command
- Docker support for easy deployment
- Environment variable configuration
- No limits on PDF page count
- Preserves original image quality and aspect ratio
- Optimized for VPS deployment
- Asynchronous operation for better performance
- Detailed logging
- Docker and Docker Compose installed on your VPS
- A valid Telegram Bot Token (obtained from @BotFather)
-
Clone this repository to your VPS:
git clone https://your-repository-url.git cd your-repository-directory -
Rename the files:
mv optimized_bot.py merged_bot.py mv optimized_pdf_generator.py pdf_generator.py mv updated_requirements.txt requirements.txt -
Edit the
.envfile and add your Telegram Bot Token:BOT_TOKEN=your_telegram_bot_token_here TEMP_DIR=/tmp
-
Build and start the Docker container:
docker-compose up -d -
Check the logs to ensure everything is running correctly:
docker-compose logs -f
To update the bot after making changes:
docker-compose down
docker-compose build
docker-compose up -d
View logs:
docker-compose logs -f
Check container status:
docker-compose ps
The bot has been optimized for VPS deployment with:
- Asynchronous image downloading with rate limiting to prevent overloading
- Efficient memory management with garbage collection
- Temporary file cleanup after operations
- Error handling and recovery
- Configurable temporary directory
After deploying the bot, users can interact with it using:
/start- Get information about the bot/anime <name>- Search for anime information/get_doujin <URL>- Download a doujin from Multporn.net as a PDF
If you encounter issues:
- Check logs with
docker-compose logs - Ensure your bot token is correct
- Verify that the VPS has enough disk space
- Check internet connectivity