This package includes simple pure python telegram bot that sends logs to chat.
from logger2telegram import Logger2tlg
tlg = Logger2tlg(chat_id="123456789", bot_id="123456789:ABCDEF1234567890ABCDEF1234567890ABC")
tlg.log("Hello world!")
- Create bot via bot_father bot in telegram
- Insert bot token to class
- Insert chat id to class: https://stackoverflow.com/a/32572159/9142932
- Create instance of logger via
tlg = Logger2tlg(chat_id = "-123456789", bot_id = "BOT TOKEN FROM BOT FATHER")
- Send urgent logs via
tlg.log("This is message")
- You may create multiple loggers to different chats or bots.
pip install logger2tlg