diff --git a/bot.py b/bot.py index 58cb723..4ed32b2 100644 --- a/bot.py +++ b/bot.py @@ -298,9 +298,8 @@ def cmd_uptime(match: Match[str]) -> Response: @handle_message(r'!pep[ ]?(?P\d{1,4})') def cmd_pep(match: Match[str]) -> Response: *_, number = match.groups() - return MessageResponse( - match, f'https://www.python.org/dev/peps/pep-{int(number).zfill(4)}/', - ) + n = str(int(number)).zfill(4) + return MessageResponse(match, f'https://www.python.org/dev/peps/pep-{n}/') COMMAND_RE = re.compile(r'!\w+')