Telegram-Print-Bot/README.md

59 lines
1.2 KiB
Markdown
Raw Normal View History

2023-11-14 17:33:44 -05:00
<img src="https://i.imgur.com/Q8K4Ujn.jpg" alt="Centered Image" width="300" height="300">
# Set Up Guide
1. Install cups
`sudo apt install cups`
2. Create a python virtual environment
2023-11-14 17:33:44 -05:00
`python3 -m venv /absolute/path/to/venv`
3. Install depends in venv
2023-11-14 17:33:44 -05:00
2023-11-14 17:35:32 -05:00
`/absolute/path/to/venv/bin/pip3 install pyTelegramBotAPI` or `/absolute/path/to/venv/bin/pip install pyTelegramBotAPI==4.14.0`
2023-11-14 17:33:44 -05:00
4. Edit tg_print.py with correct telegram API token and change directories variables.
2023-11-14 17:33:44 -05:00
5. Start the script
2023-11-14 17:33:44 -05:00
`/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
1. Send a file to the chat or directly to the bot in a PM.
2. Collect paper from the printer.
## Useful Links
https://github.com/eternnoir/pyTelegramBotAPI