From 2e616ef008cc1ec8aba712d785c234e7d87ac7f2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 25 May 2019 16:12:27 -0700 Subject: [PATCH] Add GNU/ message handler --- bot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bot.py b/bot.py index a8ced32..a75b4be 100644 --- a/bot.py +++ b/bot.py @@ -174,6 +174,15 @@ def msg_ping(match: Match[str]) -> Response: return MessageResponse(match, f'PONG {esc(rest)}') +@handle_message(r'.*\b(nano|linux|windows)\b') +def msg_gnu_please(match: Match[str]) -> Response: + msg, word = match[3], match[4] + if f'GNU/{word}' in msg: + return MessageResponse(match, f'YES! GNU/{esc(word)}') + else: + return MessageResponse(match, f"Um please, it's GNU/{esc(word)}!") + + # TODO: !tags, only allowed by stream admin / mods????