]> apps.delaporte.us Git - matrix-chore-bot.git/blobdiff - app.py
Allow space separated done list
[matrix-chore-bot.git] / app.py
diff --git a/app.py b/app.py
index ead7f4c99dc9ba8e0d6dc2151b5a2e0047e00061..fcc26524e1e055b4c0989906d08f72a825b9040d 100644 (file)
--- 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()