diff options
| author | 2019-02-12 16:49:24 +0000 | |
|---|---|---|
| committer | 2019-02-12 16:49:24 +0000 | |
| commit | b4092a14ca479c5911f8247b84f12612ed396748 (patch) | |
| tree | e65ad46b522fdde59595e08c9da998594ffccbb4 /src/utils | |
| parent | Implement IRCv3 echo-message (line_handler.py) (diff) | |
| signature | ||
Also strip \x01 off the start of CTCP commands, if it's there (utils.irc)
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/irc.py | 2 |
1 files changed, 2 insertions, 0 deletions
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) |
