tg-yd-bot - simple Telegram bot, which just resend your files from the Telegram chat with bot to selected Yandex.Disk folder. You can use it both from host or from the Docker. Feel free to send any requests about it.
When sending or forwarding photos & documents in chat with bot, it will save all to Yandex Disk in a folder (by default "bot_uploads" but you can set your own YANDEX_FOLDER for it). The bot accepts files from specific users by checking their Telegram ids. For users whose ids are not specified, the bot will not show any activity. This project made from cloud-saving-bot from Artem Nasakin
- Environment variables
- Environments support
- Paths and volumes
- How to use
- Configure virtualenv in PyCharm
- License
- Credits
- References and materials
Name | Description |
---|---|
BOT_TOKEN | Telegram bot API token. You can get it from @BotFather |
YANDEX_TOKEN | Yandex Disk API token. Get it from this link |
ALLOWED_IDS | This is the telegram id of users from whom the bot will successfully accept photos. Example in .env.example file |
YANDEX_FOLDER | Folder, which should be placed uploaded files. |
The list of environments in which the system has been tested is described below.
- MacOS 13.6.3 (
arm64v8
) - Ubuntu 24.04 LTS (
amd64
)
- Project path: /home/admin/tg-yd-bot/current
Copy env from example.
cp .env.example .env
Configure environment variables in .env
file.
./build.sh
./run.sh
- Install python and virtualenv.
brew install python3
pip install virtualenv
- Create virtualenv "venv"
virtualenv venv
virtualenv -p python3.13 venv
- Switch to virtualenv "venv"
source venv/bin/activate
- Install packages
poetry install
Running server
poetry run server
After finished you can exit from virtualenv.
Deactivate virtualenv "venv"
deactivate
dcoker compose build
docker compose up
Systemd Unit-file located at tg-yd-bot.service
. Copy it to the /etc/systemd/system
and run:
sudo systemctl daemon-reload
sudo systemctl enable tg-yd-bot
sudo systemctl start tg-yd-bot
For the best experience, you can use VSCode with Python extension. In this way please install extensionms:
pip install aiogram
pip install python-dotenv
pip install yadisk
Distributed under MIT license. See LICENSE for more information.
- This project inspired by cloud-saving-bot from Artem Nasakin.
- Refactoring and fixes by Andrei Tokarchuk.