]> us-delaporte.pagekite.me Git - matrix-chore-bot.git/blobdiff - matrix_chore_bot/bot.py
Re-enable error catch.
[matrix-chore-bot.git] / matrix_chore_bot / bot.py
index a0a3256d025fc3b21640acadfb56ecf0c5f34f75..3130d354bd0ac2805415a33505706b6262f540a9 100644 (file)
@@ -4,7 +4,9 @@ import os
 
 import simplematrixbotlib as botlib
 
 
 import simplematrixbotlib as botlib
 
-from .db import Data
+from .db import Data as ChoreData
+
+CHORES = ChoreData()
 
 SERVER = os.environ.get('MATRIX_SERVER')
 BOT_NAME = os.environ.get('MATRIX_BOT')
 
 SERVER = os.environ.get('MATRIX_SERVER')
 BOT_NAME = os.environ.get('MATRIX_BOT')
@@ -18,7 +20,6 @@ logger = logging.getLogger(__name__)
 logging.basicConfig(filename='matrix-chore-bot.log', encoding='utf-8', level=logging.DEBUG)
 logging.getLogger('nio').setLevel(logging.WARNING)
 
 logging.basicConfig(filename='matrix-chore-bot.log', encoding='utf-8', level=logging.DEBUG)
 logging.getLogger('nio').setLevel(logging.WARNING)
 
-@bot.listener.on_message_event
 async def chore_bot(room, message, bot):
     match = botlib.MessageMatch(room, message, bot, '!chore')
 
 async def chore_bot(room, message, bot):
     match = botlib.MessageMatch(room, message, bot, '!chore')
 
@@ -32,7 +33,7 @@ async def chore_bot(room, message, bot):
                 await bot.api.send_text_message(
                     room.room_id, str(line))
         except Exception as ex:
                 await bot.api.send_text_message(
                     room.room_id, str(line))
         except Exception as ex:
-            line = 'Ye cannot get ye flask.'
+            line = 'Ye flask must be load bearing, or something...'
             await bot.api.send_text_message(
                 room.room_id, str(line))
 
             await bot.api.send_text_message(
                 room.room_id, str(line))