Files
autoficher/app/telegram_bot.py
Omar Sánchez Pizarro 927c281631 separación de codigo para facil edición
Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
2023-08-02 10:06:48 +02:00

16 lines
373 B
Python

import telegram
from app import config_parser
config = config_parser.ConfigParser().loadConfig()
class telegramBot:
bot = None
def __init__(self):
self.bot = telegram.Bot(token=config['telegram']['token'])
def sendMessage(self, message):
print(message)
self.bot.sendMessage(chat_id=config['telegram']['chat_id'], text=str(message))