Skip to main content

parse_ctcp

Function parse_ctcp 

Source
pub fn parse_ctcp(body: &str) -> Option<Ctcp>
Expand description

Recognise a CTCP-wrapped body: \x01COMMAND params\x01.

The reference client slices ACTION out with a hand-rolled prefix check and renders the result without ever running it back through formatting. Returning params untouched here means a caller can hand it straight to parse_spans instead.

The closing \x01 is optional: some clients drop it, and a body missing one still names a real command.