]> apps.delaporte.us Git - matrix-cadbury.git/blobdiff - app.py
Fix restart
[matrix-cadbury.git] / app.py
diff --git a/app.py b/app.py
index be5d586421ef8db1c2e41f48a2f5f0fd7e951caf..cf07ae5ddc3b568ae5c8abef3606274c3384f79e 100644 (file)
--- a/app.py
+++ b/app.py
@@ -1,8 +1,9 @@
 import os
 
 import os
 
+from matrix_chore_bot.bot import ChoreBot
+from matrix_fridge_bot.bot import FridgeBot
 from matrix_goal_bot.bot import GoalBot
 from matrix_shop_bot.bot import shop_bot
 from matrix_goal_bot.bot import GoalBot
 from matrix_shop_bot.bot import shop_bot
-from matrix_chore_bot.bot import ChoreBot
 
 kwargs = {}
 # How to connect to Matrix
 
 kwargs = {}
 # How to connect to Matrix
@@ -24,23 +25,33 @@ chore_bot = ChoreBot(**kwargs)
 bot = chore_bot.bot
 
 
 bot = chore_bot.bot
 
 
+@bot.listener.on_message_event
+async def do_chore_stuff(room, message):
+    await chore_bot.handle_message(room, message)
+
+# Fridge Bot
+DB_FILE = os.environ.get('GOAL_DB_FILE', 'fridge.db')
+kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
+kwargs['bot_prefix'] = os.environ.get('GOAL_BOT_PREFIX', '!fridge')
+fridge_bot = FridgeBot(**kwargs) 
+fridge_bot.bot = bot
+
+@bot.listener.on_message_event
+async def do_fridge_stuff(room, message):
+    await fridge_bot.handle_message(room, message)
+
+# Goal bot
 DB_FILE = os.environ.get('GOAL_DB_FILE', 'goal.db')
 kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
 kwargs['bot_prefix'] = os.environ.get('GOAL_BOT_PREFIX', '!goal')
 goal_bot = GoalBot(**kwargs) 
 goal_bot.bot = bot
 
 DB_FILE = os.environ.get('GOAL_DB_FILE', 'goal.db')
 kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
 kwargs['bot_prefix'] = os.environ.get('GOAL_BOT_PREFIX', '!goal')
 goal_bot = GoalBot(**kwargs) 
 goal_bot.bot = bot
 
-
-@bot.listener.on_message_event
-async def do_chore_stuff(room, message):
-    await chore_bot.handle_message(room, message)
-
-
 @bot.listener.on_message_event
 async def do_goal_stuff(room, message):
     await goal_bot.handle_message(room, message)
 
 @bot.listener.on_message_event
 async def do_goal_stuff(room, message):
     await goal_bot.handle_message(room, message)
 
-
+# Shop bot has not been updated to use a class object.
 @bot.listener.on_message_event
 async def do_shopping_stuff(room, message):
     await shop_bot(room, message, bot)
 @bot.listener.on_message_event
 async def do_shopping_stuff(room, message):
     await shop_bot(room, message, bot)