separación de codigo para facil edición
Signed-off-by: Omar Sánchez Pizarro <omar.sanchez@pistacero.net>
This commit is contained in:
15
app/telegram_bot.py
Normal file
15
app/telegram_bot.py
Normal 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))
|
||||
Reference in New Issue
Block a user