X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-chore-bot.git/blobdiff_plain/67be6c948b582842dcb0e0a24b0c6eacde226bfa..refs/heads/assignments:/app.py?ds=sidebyside diff --git a/app.py b/app.py index ead7f4c..fcc2652 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,22 @@ -from matrix_chore_bot.bot import get_bot, chore_bot +import os + +import simplematrixbotlib as botlib + +from matrix_chore_bot.bot import chore_bot + +SERVER = os.environ.get('MATRIX_SERVER') +BOT_NAME = os.environ.get('MATRIX_BOT') +BOT_PWD = os.environ.get('MATRIX_BOT_PWD') +BOT_PREFIX = os.environ.get('MATRIX_BOT_PREFIX', '!chore') + +def get_bot(): + creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD) + return botlib.Bot(creds) bot = get_bot() @bot.listener.on_message_event async def do_bot_stuff(room, message): - await chore_bot(room, message, bot) + await chore_bot(room, message, bot, BOT_PREFIX) bot.run()