X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-cadbury.git/blobdiff_plain/92d06b0637338b1df9abe36c73a731c2b9fe6112..f86c05d41f140d19a41680a5002ff47554ebab2e:/app.py diff --git a/app.py b/app.py index 97b63ee..01fdc2e 100644 --- a/app.py +++ b/app.py @@ -1,14 +1,27 @@ +import os + +import simplematrixbotlib as botlib + from matrix_goal_bot.bot import get_bot, goal_bot from matrix_chore_bot.bot import chore_bot -bot = get_bot() +SERVER = os.environ.get('MATRIX_SERVER') +BOT_NAME = os.environ.get('MATRIX_BOT') +BOT_PWD = os.environ.get('MATRIX_BOT_PWD') +DATA_DIR = os.environ.get('MATRIX_DATA_DIR') + +creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD) +bot = botlib.Bot(creds) + @bot.listener.on_message_event async def do_goal_stuff(room, message): - await goal_bot(room, message, bot) + await goal_bot(room, message, bot, DATA_DIR) + @bot.listener.on_message_event async def do_chore_stuff(room, message): - await chore_bot(room, message, bot) + await chore_bot(room, message, bot, DATA_DIR) + bot.run()