From: Edward Delaporte Date: Wed, 8 Apr 2026 22:42:06 +0000 (-0500) Subject: Fixup X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-goal-bot.git/commitdiff_plain/d89a17b1ca0db37e8c6bdfae8a506f8aa33e2d82?ds=sidebyside Fixup --- diff --git a/app.py b/app.py index a34d982..1531452 100644 --- 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"]}') diff --git a/matrix_goal_bot/bot.py b/matrix_goal_bot/bot.py index 4046eeb..9e15be4 100644 --- a/matrix_goal_bot/bot.py +++ b/matrix_goal_bot/bot.py @@ -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: