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.
Dependencies are managed using pipenv.
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.