From b4092a14ca479c5911f8247b84f12612ed396748 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 12 Feb 2019 16:49:24 +0000 Subject: Also strip \x01 off the start of CTCP commands, if it's there (utils.irc) --- src/utils/irc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/utils') diff --git a/src/utils/irc.py b/src/utils/irc.py index 59624293..73a7b3de 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -281,6 +281,8 @@ def parse_ctcp(s: str) -> typing.Optional[CTCPMessage]: ctcp = s.startswith("\x01") if s.startswith("\x01"): ctcp_command, sep, ctcp_message = s[1:].partition(" ") + if ctcp_command.endswith("\x01"): + ctcp_command = ctcp_command[:-1] if ctcp_message.endswith("\x01"): ctcp_message = ctcp_message[:-1] return CTCPMessage(ctcp_command, ctcp_message) -- cgit v1.3.1-10-gc9f91