CHORES = ChoreData()
-def get_bot():
- creds = botlib.Creds(SERVER, BOT_NAME, BOT_PWD)
- return botlib.Bot(creds)
-
logger = logging.getLogger(__name__)
logging.basicConfig(filename='matrix-chore-bot.log', encoding='utf-8', level=logging.DEBUG)
logging.getLogger('nio').setLevel(logging.WARNING)
-async def chore_bot(room, message, bot):
- match = botlib.MessageMatch(room, message, bot, '!chore')
+async def chore_bot(room, message, bot, prefix='!chore'):
+ match = botlib.MessageMatch(room, message, bot, prefix)
if not match.is_not_from_this_bot() and match.prefix():
return
await bot.api.send_text_message(
room.room_id, str(line))
except Exception as ex:
- line = 'Ye flask must be load bearing, or something...'
+ line = f'Ye flask must be load bearing, or something... {str(ex)}'
await bot.api.send_text_message(
room.room_id, str(line))