]> apps.delaporte.us Git - matrix-goal-bot.git/commitdiff
Fixup
authorEdward Delaporte <edward@delaporte.us>
Wed, 8 Apr 2026 22:42:06 +0000 (17:42 -0500)
committerEdward Delaporte <edward@delaporte.us>
Wed, 8 Apr 2026 22:42:06 +0000 (17:42 -0500)
app.py
matrix_goal_bot/bot.py

diff --git a/app.py b/app.py
index a34d982950b96b4ce8e775f68f3de126857dd74c..15314522a1f0774bb223ff27ce47d0945b87f2ba 100644 (file)
--- a/app.py
+++ b/app.py
@@ -17,7 +17,7 @@ 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')
+kwargs['bot_prefix'] = os.environ.get('MATRIX_BOT_PREFIX', '!goal')
 
 logger.info(f'Goal bot will connect to {kwargs["matrix_server"]} as {kwargs["bot_name"]}')
 
index 4046eeb39221f92bd56535eaf7e0e7be8ab96d2d..9e15be4dbe526984c587bf5cfa5cd23563577d6a 100644 (file)
@@ -75,8 +75,12 @@ class GoalBot():
         match = botlib.MessageMatch(room, message, self.bot, self.prefix)
 
         if not match.is_not_from_this_bot() and match.prefix():
+            logger.debug(f'Message: {message} was not for this bot.')
             return
 
+        if not match.prefix():
+            logger.debug(f'{message} - did not match {self.prefix}')
+
         if match.prefix():
             try:
                 result_lines = await self._handle_match(match)
@@ -84,11 +88,13 @@ class GoalBot():
                     await self.bot.api.send_text_message(
                         room.room_id, str(line))
             except Exception as ex:
+                logger.warn(f'Caught exception: {str(ex)}')
                 await self.bot.api.send_text_message(
                     room.room_id, str(ex))
 
 
     async def _handle_match(self, match):
+        logger.debug(f'Try to match {str(match)}')
 
         if match.command('setup'):
             result = self.data.setup()
@@ -100,6 +106,7 @@ class GoalBot():
             return [f'Goal added with id {result}']
 
         if match.command('list'):
+            logger.debug('Asked to list goals...')
             goals = self.data.get_all_goals()
             results = ['# Goals list...']
             for goal in goals: