Clarth
3cd1137b84
Added image handling. Can't print inline images, but will remind the user to send the image as a file. |
||
---|---|---|
README.md | ||
marvin.jpg | ||
tg_print.py |
README.md
Set Up Guide
- Install cups
sudo apt install cups
- Create a python virtual environment
python3 -m venv /absolute/path/to/venv
- Install depends in venv
/absolute/path/to/venv/bin/pip3 install pyTelegramBotAPI
or /absolute/path/to/venv/bin/pip install pyTelegramBotAPI==4.14.0
-
Edit tg_print.py with correct telegram API token and change directories variables.
-
Start the script
/absolute/path/to/venv/bin/python tg_print.py
Unit file
[Unit]
Description=tg_spotdl
After=network-online.target
[Service]
User=nobody
ExecStart=/absolute/path/to/venv/bin/python /absolute/path/to/start.py
Restart=always
RestartSec=5s
RuntimeMaxSec=12h
[Install]
WantedBy=multi-user.target
Start Script
Recommend running in a screen or tmux.
#!/bin/bash
/absolute/path/to/venv/bin/python /absolute/path/to/start.py
exit
Usage
- Send a file to the chat or directly to the bot in a PM.
- Collect paper from the printer.