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)
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()
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: