sharath3589 bbaab6af04 feat: schedule posts at IST times regardless of server timezone
- All scheduling now uses IST (Asia/Kolkata) timezone
- Posts happen at 11:00, 16:00, 21:00 IST regardless of server location
- Improved datetime handling with timezone-aware operations
- Updated all display times to show IST explicitly
2025-10-22 11:40:52 +05:30
2025-10-18 17:23:35 +05:30
2025-10-18 17:23:35 +05:30
2025-10-18 17:23:35 +05:30
2025-10-18 17:23:35 +05:30
2025-10-18 17:23:35 +05:30
2025-10-18 17:23:35 +05:30

Meme Wrangler Bot

Telegram bot that accepts memes (photos, GIF animations, videos) from the owner's private messages and schedules them into a channel at the next available slot among 11:00, 16:00, 21:00.

Setup

The easiest way to run the bot is using Docker:

  1. Set up environment variables:

    cp .env.example .env
    nano .env  # Edit with your bot credentials
    
  2. Run with Docker Compose:

    docker-compose up -d
    
  3. View logs:

    docker-compose logs -f
    
  4. Stop the bot:

    docker-compose down
    

For detailed Docker deployment instructions, including remote server deployment, see DOCKER_DEPLOY.md.

Option 2: Run Locally

  1. Create a virtualenv and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Set environment variables:
export TELEGRAM_BOT_TOKEN=123:ABC
export OWNER_ID=123456789
export CHANNEL_ID=@yourchannel  # or -1001234567890
  1. Run the bot:
python bot.py

How it works

  • Owner sends a photo/video/animation in the bot's DM.
  • Bot stores the Telegram file_id and schedules it for the next available slot: 11:00, 16:00, 21:00. If there's an existing scheduled meme, new ones are scheduled after the last one using the same cycle.
  • A background task posts due memes into the configured channel.

Docker Implementation

This project includes full Docker support for easy deployment:

  • Dockerfile: Creates a lightweight Python container with all dependencies
  • docker-compose.yml: Simplifies running the bot with proper configuration
  • Volume mounting: Database persists between container restarts in ./data directory
  • Auto-restart: Container automatically restarts if it crashes
  • Logging: Configured with log rotation (10MB max, 3 files)

The Docker implementation ensures consistent behavior across different environments and simplifies deployment to production servers.

Notes

  • Times are computed using server local time. Stored timestamps are Unix timestamps.
  • Make sure the bot is admin in the channel to post messages.
  • When using Docker, the database is stored in ./data/memes.db on the host machine.
Description
No description provided
Readme 83 KiB
Languages
Python 90.7%
Shell 7%
Dockerfile 2.3%