X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-chore-bot.git/blobdiff_plain/0e8e2296efcfab2892ec552b04e46450554fd06a..99f1517e1c2cd574b1969a79d5631769f789debb:/matrix_chore_bot/bot.py?ds=inline diff --git a/matrix_chore_bot/bot.py b/matrix_chore_bot/bot.py index 7e33ade..c97be63 100644 --- a/matrix_chore_bot/bot.py +++ b/matrix_chore_bot/bot.py @@ -47,15 +47,24 @@ async def handle_chore(match): check - check status of a chore done - mark a chore as done list - print the chore list + filter TERM - list all chores that include TERM undo - mark a chore as undone ''' if match.command('list'): - results = ['## Listing chores...'] + results = ['## Listing all...'] for item in CHORES.list(): results.append(item) results.append('-- End of List --') return results + + if match.command('filter'): + term = ' '.join(match.args()[1:]) + results = [f'## List matching {term}'] + for item in CHORES.filter(term): + results.append(item) + results.append('-- End of List --') + return results if match.command('setup'): results = []