Fix the gnu+thing patch

This commit is contained in:
Anthony Sottile 2019-10-19 15:03:52 -07:00
parent d5e3738eed
commit 8aa6c71184
1 changed files with 2 additions and 2 deletions

4
bot.py
View File

@ -320,9 +320,9 @@ def msg_ping(match: Match[str]) -> Response:
@handle_message(r'.*\b(nano|linux|windows|emacs)\b', flags=re.IGNORECASE) @handle_message(r'.*\b(nano|linux|windows|emacs)\b', flags=re.IGNORECASE)
def msg_gnu_please(match: Match[str]) -> Response: def msg_gnu_please(match: Match[str]) -> Response:
msg, word = match[3], match[4] msg, word = match[3], match[4]
query = re.match(fr'gnu[/+]{word}', msg, flags=re.IGNORECASE) query = re.match(f'gnu[/+]{word}', msg, flags=re.IGNORECASE)
if query: if query:
return MessageResponse(match, f'YES! {query.match(0)}') return MessageResponse(match, f'YES! {query[0]}')
else: else:
return MessageResponse(match, f"Um please, it's GNU/{esc(word)}!") return MessageResponse(match, f"Um please, it's GNU/{esc(word)}!")