Send a photo via Telegram
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Aug 2, 2018
LICENSE Readme and license Jan 8, 2019
Pipfile Support Sentry Oct 13, 2018
Pipfile.lock Support Sentry Oct 13, 2018
README.md Update README.md Jan 8, 2019
daily_photo.py Deal with photos that don't have the orientation tag Jan 13, 2019

README.md

Daily Photo

This application picks up a photo from a specified directory, sends it to a specified Telegram chat and then deletes that photo. Simple as that.

I use it to make a "Daily Photo" channel.

Usage

Dependencies are managed using pipenv.

You should set up your Telegram bot and invite it to your desired channel or group. Then you should pick up the chat id from https://api.telegram.org/YOUR_TOKEN/getUpdates

Define the following environment variables:

  • DAILY_PHOTO_DIRECTORY - The directory containing the photos
  • DAILY_PHOTO_BOT_TOKEN - The token of your bot
  • DAILY_PHOTO_CHAT_ID - The chat ID of the group, channel or chat
  • Optional DAILY_PHOTO_SENTRY_DSN - A DSN for Sentry

After the you can just run the app with pipenv run daily_photo. The app should send a single photo and then quit. You can use cron, systemd-timers or any other scheduler to run it periodically.