X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-chore-bot.git/blobdiff_plain/96d01de852abf2944122075f954feb7aa536f0e4..0e8e2296efcfab2892ec552b04e46450554fd06a:/app.py?ds=inline 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()