diff --git a/bot.py b/bot.py index b0da137..4b9976a 100644 --- a/bot.py +++ b/bot.py @@ -295,6 +295,16 @@ def cmd_uptime(match: Match[str]) -> Response: return UptimeResponse() +@handle_message('!pep') +def cmd_pep(match: Match[str]) -> Response: + _, _, msg = match.groups() + _, _, rest = msg.partition(' ') + return MessageResponse( + match, + f'https://www.python.org/dev/peps/pep-{rest.zfill(4)}/', + ) + + COMMAND_RE = re.compile(r'!\w+') SECRET_CMDS = frozenset(('!settoday',))