Also strip \x01 off the start of CTCP commands, if it's there (utils.irc)
This commit is contained in:
parent
b2d942027e
commit
b4092a14ca
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue