edgeport - v1.0.6
    Preparing search index...

    Function parseCtcp

    • Extracts a CTCP command and its arguments from a message body.

      CTCP wraps the payload in \x01 delimiters, e.g. an action is \x01ACTION waves\x01. Returns the uppercased command and the remaining argument string, or undefined when the text is not CTCP-wrapped.

      Parameters

      • text: string

        The PRIVMSG/NOTICE body.

      Returns { args: string; command: string } | undefined

      { command, args } for a CTCP payload, else undefined.

      1.0.4

      import { parseCtcp } from 'edgeport/irc';

      parseCtcp('\x01ACTION waves\x01'); // { command: 'ACTION', args: 'waves' }
      parseCtcp('just text'); // undefined