separación de codigo para facil edición

Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
Omar Sánchez Pizarro
2023-08-02 10:06:48 +02:00
parent 76cf03f883
commit 927c281631
15 changed files with 333 additions and 266 deletions

15
app/telegram_bot.py Normal file
View File

@@ -0,0 +1,15 @@
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))