Bug fixed. GNU and gnu

When "gnu /" was placed the bot responded as if it had not written gnu. I added an or in the if of line 194 to include the word gnu
This commit is contained in:
tati1206 2019-07-13 19:15:47 -03:00 committed by GitHub
parent 69aed2815b
commit ece8ba6004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

2
bot.py
View File

@ -191,7 +191,7 @@ def msg_ping(match: Match[str]) -> Response:
@handle_message(r'.*\b(nano|linux|windows)\b') @handle_message(r'.*\b(nano|linux|windows)\b')
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]
if f'GNU/{word}' in msg: if f'GNU/{word}' in msg or f'gnu/{word}' in msg:
return MessageResponse(match, f'YES! GNU/{esc(word)}') return MessageResponse(match, f'YES! GNU/{esc(word)}')
else: else:
return MessageResponse(match, f"Um please, it's GNU/{esc(word)}!") return MessageResponse(match, f"Um please, it's GNU/{esc(word)}!")