]> us-delaporte.pagekite.me Git - matrix-cadbury.git/blobdiff - app.py
easier prefix to type
[matrix-cadbury.git] / app.py
diff --git a/app.py b/app.py
index 5ce14381bdfaa3e5587414bb24fee369f06b3863..72ab7a3a0ee553bc11340e71dcbe2aef0d57ce5e 100644 (file)
--- a/app.py
+++ b/app.py
@@ -17,7 +17,7 @@ kwargs['bot_pwd'] = os.environ.get('MATRIX_BOT_PWD')
 DATA_DIR = os.environ.get('MATRIX_DATA_DIR', '')
 DB_FILE = os.environ.get('CHORE_DB_FILE', 'chore.db')
 kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
-kwargs['bot_prefix'] = os.environ.get('CHORE_BOT_PREFIX', '!chore')
+kwargs['bot_prefix'] = os.environ.get('CHORE_BOT_PREFIX', '.chore')
 chore_bot = ChoreBot(**kwargs) 
 
 
@@ -25,29 +25,39 @@ chore_bot = ChoreBot(**kwargs)
 bot = chore_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)
 
+# 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
 
 @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 for daily school tasks, using ChoreBot source code
-kwargs['bot_prefix'] = os.environ.get('SCHOOL_BOT_PREFIX', '!school')
+kwargs['bot_prefix'] = os.environ.get('SCHOOL_BOT_PREFIX', '.school')
 DB_FILE = os.environ.get('SCHOOL_DB_FILE', 'school.db')
 kwargs['db_file'] = os.path.join(DATA_DIR, DB_FILE)
 school_bot = ChoreBot(**kwargs)