Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

r-darwish/daily_photo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.