Skip to content

Instantly share code, notes, and snippets.

@osuzdalev
osuzdalev / printerbot.py
Last active January 12, 2023 14:32 — forked from PolarNick239/printerbot.py
Telegram bot for printer (Linux)
"""
Telegram Bot to print pdf and txt files.
Users must first authorize themselves by entering the password using the command "/auth <password>".
This implementation works only for UNIX and uses "lp -d <printer> <file>" to print files (see function "print_file").
"""
import os
import pathlib
import logging