-from matrix_chore_bot.bot import get_bot, chore_bot
+import os
-bot = get_bot()
+from matrix_chore_bot.bot import ChoreBot
-@bot.listener.on_message_event
+kwargs = {}
+# How to connect to Matrix
+kwargs['matrix_server'] = os.environ.get('MATRIX_SERVER')
+kwargs['bot_name'] = os.environ.get('MATRIX_BOT')
+kwargs['bot_pwd'] = os.environ.get('MATRIX_BOT_PWD')
+
+# Prefix to listen for
+kwargs['bot_prefix'] = os.environ.get('MATRIX_BOT_PREFIX', '!chore')
+
+# Where to store data
+DATA_DIR = os.environ.get('MATRIX_DATA_DIR', '')
+DB_FILE = os.environ.get('MATRIX_DB_FILE', 'chore.db')
+kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
+
+print(kwargs)
+
+chore_bot = ChoreBot(**kwargs)
+
+@chore_bot.bot.listener.on_message_event
async def do_bot_stuff(room, message):
- await chore_bot(room, message, bot)
+ '''Pass messages to our bot'''
+ await chore_bot.handle_message(room, message)
-bot.run()
+chore_bot.run()