Telegram-based application for photo-contests in group chats. Allows for instant photo registration and tracks contest themes with #. Also includes an admin menu for easy management and a leaderboard for tracking results.
To access the bot, use the @photoshnaya_bot handle or go to How to Use section for self-host.
- Instant photo registration through contest themes followed by #
- Restricts user's photo registration to one per contest
- Includes an easy-to-use admin menu at /admin
- Uploads the winner's photo as the group chat photo
- Tracks results and generates a leaderboard for both winners and participants
- Clone the repository and rename env.example to .env.
- Fill in the bot token and postgre_url in the .env file.
- Start the application by using docker-compose up --build -d.
GitHub Actions can build, push, and deploy the bot to a remote host over SSH after tests pass on main.
Required GitHub secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKENDEPLOY_HOSTDEPLOY_USERDEPLOY_SSH_KEYDEPLOY_KNOWN_HOSTSDEPLOY_PATHDEPLOY_PORT(optional, defaults to22)
Remote host requirements:
- Docker with
docker composeordocker-compose - checked-out project directory at
DEPLOY_PATH - production env already present on the server
Deployment flow:
- CI runs flake8 and
docker compose -f docker-compose.test.yml up. - On push to
main, CI builds and pushes${DOCKERHUB_USERNAME}/photoshnaya_botwithlatestand${GITHUB_SHA}tags. - CI SSHes to the remote host, exports
IMAGE_REPOSITORYandIMAGE_TAG, then runsdocker compose pull web && docker compose up -d web. 4) Switch off Group Privacy for the bot via BotFather menu. 5) Add bot to the needed group and grant administration rights. 6) Shutdown the application with docker-compose down.
- This application should work on any platform that supports Docker.


