# ``twisted`.`words`.`protocols`.`irc``

module documentation
(source)

Internet Relay Chat protocol for client and server.

## Future Plans

The way the IRCClient class works here encourages people to implement IRC clients by subclassing the ephemeral protocol class, and it tends to end up with way more state than it should for an object which will be destroyed as soon as the TCP transport drops. Someone oughta do something about that, ya know?

The DCC support needs to have more hooks for the client for it to be able to ask the user things like "Do you want to accept this session?" and "Transfer #2 is 67% done." and otherwise manage the DCC sessions.

Test coverage needs to be better.

Author
Kevin Turner
See Also
RFC 1459: Internet Relay Chat Protocol
RFC 2812: Internet Relay Chat: Client Protocol
The Client-To-Client-Protocol

Class | `DccChat` | Direct Client Connection protocol type CHAT.
Class | `DccChatFactory` | Undocumented
Class | `DccFileReceive` | Higher-level coverage for getting a file from DCC SEND.
Class | `DccFileReceiveBasic` | Bare protocol to receive a Direct Client Connection SEND stream.
Class | `DccSendFactory` | Undocumented
Class | `DccSendProtocol` | Protocol for an outgoing Direct Client Connection SEND.
Class | `IRC` | Internet Relay Chat server protocol.
Class | `IRCBadMessage` | Undocumented
Class | `IRCBadModes` | A malformed mode was encountered while attempting to parse a mode string.
Class | `IRCClient` | Internet Relay Chat client protocol, with sprinkles.
Class | `IRCPasswordMismatch` | Undocumented
Class | `ServerSupportedFeatures` | Handle ISUPPORT messages.
Class | `UnhandledCommand` | A command dispatcher could not locate an appropriate command handler.
Function | `assembleFormattedText` | Assemble formatted text from structured information.
Function | `ctcpDequote` | Undocumented
Function | `ctcpExtract` | Extract CTCP data from a string.
Function | `ctcpQuote` | Undocumented
Function | `ctcpStringify` |
Function | `dccDescribe` | Given the data chunk from a DCC query, return a descriptive string.
Function | `dccParseAddress` | Undocumented
Function | `fileSize` | I'll try my damndest to determine the size of this file object.
Function | `lowDequote` | Undocumented
Function | `lowQuote` | Undocumented
Function | `parseFormattedText` | Parse text containing IRC formatting codes into structured information.
Function | `parseModes` | Parse an IRC mode string.
Function | `parsemsg` | Breaks a message from an IRC server into its prefix, command, and arguments.
Function | `split` | Split a string into multiple lines.
Function | `stripFormatting` | Remove all formatting codes from `text`, leaving only the text.
Constant | `CHANNEL_PREFIXES` | Undocumented
Constant | `CR` | Undocumented
Constant | `ERR_ALREADYREGISTRED` | Undocumented
Constant | `ERR_BADCHANMASK` | Undocumented
Constant | `ERR_BADCHANNELKEY` | Undocumented
Constant | `ERR_BADMASK` | Undocumented
Constant | `ERR_BANLISTFULL` | Undocumented
Constant | `ERR_BANNEDFROMCHAN` | Undocumented
Constant | `ERR_CANNOTSENDTOCHAN` | Undocumented
Constant | `ERR_CANTKILLSERVER` | Undocumented
Constant | `ERR_CHANNELISFULL` | Undocumented
Constant | `ERR_CHANOPRIVSNEEDED` | Undocumented
Constant | `ERR_ERRONEUSNICKNAME` | Undocumented
Constant | `ERR_FILEERROR` | Undocumented
Constant | `ERR_INVITEONLYCHAN` | Undocumented
Constant | `ERR_KEYSET` | Undocumented
Constant | `ERR_NEEDMOREPARAMS` | Undocumented
Constant | `ERR_NICKCOLLISION` | Undocumented
Constant | `ERR_NICKNAMEINUSE` | Undocumented
Constant | `ERR_NOADMININFO` | Undocumented
Constant | `ERR_NOCHANMODES` | Undocumented
Constant | `ERR_NOLOGIN` | Undocumented
Constant | `ERR_NOMOTD` | Undocumented
Constant | `ERR_NONICKNAMEGIVEN` | Undocumented
Constant | `ERR_NOOPERHOST` | Undocumented
Constant | `ERR_NOORIGIN` | Undocumented
Constant | `ERR_NOPERMFORHOST` | Undocumented
Constant | `ERR_NOPRIVILEGES` | Undocumented
Constant | `ERR_NORECIPIENT` | Undocumented
Constant | `ERR_NOSERVICEHOST` | Undocumented
Constant | `ERR_NOSUCHCHANNEL` | Undocumented
Constant | `ERR_NOSUCHNICK` | Undocumented
Constant | `ERR_NOSUCHSERVER` | Undocumented
Constant | `ERR_NOSUCHSERVICE` | Undocumented
Constant | `ERR_NOTEXTTOSEND` | Undocumented
Constant | `ERR_NOTONCHANNEL` | Undocumented
Constant | `ERR_NOTOPLEVEL` | Undocumented
Constant | `ERR_NOTREGISTERED` | Undocumented
Constant | `ERR_PASSWDMISMATCH` | Undocumented
Constant | `ERR_RESTRICTED` | Undocumented
Constant | `ERR_SUMMONDISABLED` | Undocumented
Constant | `ERR_TOOMANYCHANNELS` | Undocumented
Constant | `ERR_TOOMANYMATCHES` | Undocumented
Constant | `ERR_TOOMANYTARGETS` | Undocumented
Constant | `ERR_UMODEUNKNOWNFLAG` | Undocumented
Constant | `ERR_UNAVAILRESOURCE` | Undocumented
Constant | `ERR_UNIQOPPRIVSNEEDED` | Undocumented
Constant | `ERR_UNKNOWNCOMMAND` | Undocumented
Constant | `ERR_UNKNOWNMODE` | Undocumented
Constant | `ERR_USERNOTINCHANNEL` | Undocumented
Constant | `ERR_USERONCHANNEL` | Undocumented
Constant | `ERR_USERSDISABLED` | Undocumented
Constant | `ERR_USERSDONTMATCH` | Undocumented
Constant | `ERR_WASNOSUCHNICK` | Undocumented
Constant | `ERR_WILDTOPLEVEL` | Undocumented
Constant | `ERR_YOUREBANNEDCREEP` | Undocumented
Constant | `ERR_YOUWILLBEBANNED` | Undocumented
Constant | `M_QUOTE` | Undocumented
Constant | `MAX_COMMAND_LENGTH` | The maximum length of a command, as defined by RFC 2812 section 2.3.
Constant | `NL` | Undocumented
Constant | `NUL` | Undocumented
Constant | `RPL_ADMINEMAIL` | Undocumented
Constant | `RPL_ADMINLOC1` | Undocumented
Constant | `RPL_ADMINLOC2` | Undocumented
Constant | `RPL_ADMINME` | Undocumented
Constant | `RPL_AWAY` | Undocumented
Constant | `RPL_BANLIST` | Undocumented
Constant | `RPL_BOUNCE` | Undocumented
Constant | `RPL_CHANNELMODEIS` | Undocumented
Constant | `RPL_CREATED` | Undocumented
Constant | `RPL_ENDOFBANLIST` | Undocumented
Constant | `RPL_ENDOFEXCEPTLIST` | Undocumented
Constant | `RPL_ENDOFINFO` | Undocumented
Constant | `RPL_ENDOFINVITELIST` | Undocumented
Constant | `RPL_ENDOFLINKS` | Undocumented
Constant | `RPL_ENDOFMOTD` | Undocumented
Constant | `RPL_ENDOFNAMES` | Undocumented
Constant | `RPL_ENDOFSTATS` | Undocumented
Constant | `RPL_ENDOFUSERS` | Undocumented
Constant | `RPL_ENDOFWHO` | Undocumented
Constant | `RPL_ENDOFWHOIS` | Undocumented
Constant | `RPL_ENDOFWHOWAS` | Undocumented
Constant | `RPL_EXCEPTLIST` | Undocumented
Constant | `RPL_INFO` | Undocumented
Constant | `RPL_INVITELIST` | Undocumented
Constant | `RPL_INVITING` | Undocumented
Constant | `RPL_ISON` | Undocumented
Constant | `RPL_ISUPPORT` | Undocumented
Constant | `RPL_LINKS` | Undocumented
Constant | `RPL_LIST` | Undocumented
Constant | `RPL_LISTEND` | Undocumented
Constant | `RPL_LISTSTART` | Undocumented
Constant | `RPL_LUSERCHANNELS` | Undocumented
Constant | `RPL_LUSERCLIENT` | Undocumented
Constant | `RPL_LUSERME` | Undocumented
Constant | `RPL_LUSEROP` | Undocumented
Constant | `RPL_LUSERUNKNOWN` | Undocumented
Constant | `RPL_MOTD` | Undocumented
Constant | `RPL_MOTDSTART` | Undocumented
Constant | `RPL_MYINFO` | Undocumented
Constant | `RPL_NAMREPLY` | Undocumented
Constant | `RPL_NOTOPIC` | Undocumented
Constant | `RPL_NOUSERS` | Undocumented
Constant | `RPL_NOWAWAY` | Undocumented
Constant | `RPL_REHASHING` | Undocumented
Constant | `RPL_SERVLIST` | Undocumented
Constant | `RPL_SERVLISTEND` | Undocumented
Constant | `RPL_STATSCOMMANDS` | Undocumented
Constant | `RPL_STATSLINKINFO` | Undocumented
Constant | `RPL_STATSOLINE` | Undocumented
Constant | `RPL_STATSUPTIME` | Undocumented
Constant | `RPL_SUMMONING` | Undocumented
Constant | `RPL_TIME` | Undocumented
Constant | `RPL_TOPIC` | Undocumented
Constant | `RPL_TRACECLASS` | Undocumented
Constant | `RPL_TRACECONNECTING` | Undocumented
Constant | `RPL_TRACEEND` | Undocumented
Constant | `RPL_TRACEHANDSHAKE` | Undocumented
Constant | `RPL_TRACELINK` | Undocumented
Constant | `RPL_TRACELOG` | Undocumented
Constant | `RPL_TRACENEWTYPE` | Undocumented
Constant | `RPL_TRACEOPERATOR` | Undocumented
Constant | `RPL_TRACERECONNECT` | Undocumented
Constant | `RPL_TRACESERVER` | Undocumented
Constant | `RPL_TRACESERVICE` | Undocumented
Constant | `RPL_TRACEUNKNOWN` | Undocumented
Constant | `RPL_TRACEUSER` | Undocumented
Constant | `RPL_TRYAGAIN` | Undocumented
Constant | `RPL_UMODEIS` | Undocumented
Constant | `RPL_UNAWAY` | Undocumented
Constant | `RPL_UNIQOPIS` | Undocumented
Constant | `RPL_USERHOST` | Undocumented
Constant | `RPL_USERS` | Undocumented
Constant | `RPL_USERSSTART` | Undocumented
Constant | `RPL_VERSION` | Undocumented
Constant | `RPL_WELCOME` | Undocumented
Constant | `RPL_WHOISCHANNELS` | Undocumented
Constant | `RPL_WHOISIDLE` | Undocumented
Constant | `RPL_WHOISOPERATOR` | Undocumented
Constant | `RPL_WHOISSERVER` | Undocumented
Constant | `RPL_WHOISUSER` | Undocumented
Constant | `RPL_WHOREPLY` | Undocumented
Constant | `RPL_WHOWASUSER` | Undocumented
Constant | `RPL_YOUREOPER` | Undocumented
Constant | `RPL_YOURESERVICE` | Undocumented
Constant | `RPL_YOURHOST` | Undocumented
Constant | `SPC` | Undocumented
Constant | `X_DELIM` | Undocumented
Constant | `X_QUOTE` | Undocumented
Variable | `attributes` | Singleton instance of `_CharacterAttributes`, used for constructing formatted text information.
Variable | `mDequoteTable` | Undocumented
Variable | `mEscape_re` | Undocumented
Variable | `mQuoteTable` | Undocumented
Variable | `numeric_to_symbolic` | Undocumented
Variable | `symbolic_to_numeric` | Undocumented
Variable | `xDequoteTable` | Undocumented
Variable | `xEscape_re` | Undocumented
Variable | `xQuoteTable` | Undocumented
Class | `_CharacterAttributes` | Factory for character attributes, including foreground and background color and non-color attributes such as bold, reverse video and underline.
Class | `_CommandDispatcherMixin` | Dispatch commands to handlers based on their name.
Class | `_FormattingParser` | A finite-state machine that parses formatted IRC text.
Class | `_FormattingState` | Formatting state/attributes of a single character.
Function | `_foldr` | Apply a function of two arguments cumulatively to the items of a sequence, from right to left, so as to reduce the sequence to a single value.
Function | `_intOrDefault` | Convert a value to an integer if possible.
Constant | `_BOLD` | Undocumented
Constant | `_COLOR` | Undocumented
Constant | `_IRC_COLOR_NAMES` | Undocumented
Constant | `_IRC_COLORS` | Undocumented
Constant | `_OFF` | Undocumented
Constant | `_REVERSE_VIDEO` | Undocumented
Constant | `_UNDERLINE` | Undocumented

def assembleFormattedText(formatted): (source)

Assemble formatted text from structured information.

Currently handled formatting includes: bold, reverse, underline, mIRC color codes and the ability to remove all current formatting.

It is worth noting that assembled text will always begin with the control code to disable other attributes for the sake of correctness.

For example:

        from twisted.words.protocols.irc import attributes as A
        assembleFormattedText(
            A.normal[A.bold['Time: '], A.fg.lightRed['Now!']])

Would produce "Time: " in bold formatting, followed by "Now!" with a foreground color of light red and without any additional formatting.

Available attributes are:

- bold
- reverseVideo
- underline

Available colors are:

1. white
2. black
3. blue
4. green
5. light red
6. red
7. magenta
8. orange
9. yellow
10. light green
11. cyan
12. light cyan
13. light blue
14. light magenta
15. gray
16. light gray

Parameters
formatted | Structured text and attributes.
Returns
`str` | String containing mIRC control sequences that mimic those specified by formatted.
See Also
http://www.mirc.co.uk/help/color.txt
Present Since
13.1

def ctcpDequote(s): (source)

Undocumented

def ctcpExtract(message): (source)
Extract CTCP data from a string.

Returns

A `dict` containing two keys:

- `'extended'`: A list of CTCP (tag, data) tuples.
- `'normal'`: A list of strings which were not inside a CTCP delimiter.

def ctcpQuote(s): (source)

Undocumented

def ctcpStringify(messages): (source)

Parameters
messages:a list of extended messages. An extended message is a (tag, data) tuple, where 'data' may be `None`, a string, or a list of strings to be joined with whitespace. | Undocumented
Returns
String

def dccDescribe(data): (source)
Given the data chunk from a DCC query, return a descriptive string.

Parameters
data:`bytes` | The data from a DCC query.
Returns
`bytes` | A descriptive string.

def dccParseAddress(address): (source)

Undocumented

def fileSize(file): (source)
I'll try my damndest to determine the size of this file object.

Parameters
file:`io.IOBase` | The file object to determine the size of.
Returns
`int` or `None` | The size of the file object as an integer if it can be determined, otherwise return `None`.

def lowDequote(s): (source)

Undocumented

def lowQuote(s): (source)

Undocumented

def parseFormattedText(text): (source)

Parse text containing IRC formatting codes into structured information.

Color codes are mapped from 0 to 15 and wrap around if greater than 15.

Parameters
text:`str` | Formatted text to parse.
Returns
Structured text and attributes.
Present Since
13.1

def parseModes(modes, params, paramModes=('', '')): (source)

Parse an IRC mode string.

The mode string is parsed into two lists of mode changes (added and removed), with each mode change represented as `(mode, param)` where mode is the mode character, and param is the parameter passed for that mode, or `None` if no parameter is required.

Parameters
modes:`str` | Modes string to parse.
params:`list` | Parameters specified along with `modes`.
paramModes:`(str, str)` | A pair of strings (`(add, remove)`) that indicate which modes take parameters when added or removed.
Returns
Two lists of mode changes, one for modes added and the other for modes removed respectively, mode changes in each list are represented as `(mode, param)`.

def parsemsg(s): (source)
Breaks a message from an IRC server into its prefix, command, and arguments.

Parameters
s:`bytes` | The message to break.
Returns
`tuple` | A tuple of (prefix, command, args).

def split(str, length=80): (source)

Split a string into multiple lines.

Whitespace near `str[length]` will be preferred as a breaking point. `"\n"` will also be used as a breaking point.

Parameters
str:`str` | The string to split.
length:`int` | The maximum length which will be allowed for any string in the result.
Returns
`list` of `str`

def stripFormatting(text): (source)
Remove all formatting codes from `text`, leaving only the text.

Parameters
text:`str` | Formatted text to parse.
Returns
`str` | Plain text without any control sequences.
Present Since
13.1

CHANNEL_PREFIXES: `str` = (source)

Undocumented

Value

    '&#!+'

CR = (source)

Undocumented

Value

    chr(13)

ERR_ALREADYREGISTRED: `str` = (source)

Undocumented

Value

    '462'

ERR_BADCHANMASK: `str` = (source)

Undocumented

Value

    '476'

ERR_BADCHANNELKEY: `str` = (source)

Undocumented

Value

    '475'

ERR_BADMASK: `str` = (source)

Undocumented

Value

    '415'

ERR_BANLISTFULL: `str` = (source)

Undocumented

Value

    '478'

ERR_BANNEDFROMCHAN: `str` = (source)

Undocumented

Value

    '474'

ERR_CANNOTSENDTOCHAN: `str` = (source)

Undocumented

Value

    '404'

ERR_CANTKILLSERVER: `str` = (source)

Undocumented

Value

    '483'

ERR_CHANNELISFULL: `str` = (source)

Undocumented

Value

    '471'

ERR_CHANOPRIVSNEEDED: `str` = (source)

Undocumented

Value

    '482'

ERR_ERRONEUSNICKNAME: `str` = (source)

Undocumented

Value

    '432'

ERR_FILEERROR: `str` = (source)

Undocumented

Value

    '424'

ERR_INVITEONLYCHAN: `str` = (source)

Undocumented

Value

    '473'

ERR_KEYSET: `str` = (source)

Undocumented

Value

    '467'

ERR_NEEDMOREPARAMS: `str` = (source)

Undocumented

Value

    '461'

ERR_NICKCOLLISION: `str` = (source)

Undocumented

Value

    '436'

ERR_NICKNAMEINUSE: `str` = (source)

Undocumented

Value

    '433'

ERR_NOADMININFO: `str` = (source)

Undocumented

Value

    '423'

ERR_NOCHANMODES: `str` = (source)

Undocumented

Value

    '477'

ERR_NOLOGIN: `str` = (source)

Undocumented

Value

    '444'

ERR_NOMOTD: `str` = (source)

Undocumented

Value

    '422'

ERR_NONICKNAMEGIVEN: `str` = (source)

Undocumented

Value

    '431'

ERR_NOOPERHOST: `str` = (source)

Undocumented

Value

    '491'

ERR_NOORIGIN: `str` = (source)

Undocumented

Value

    '409'

ERR_NOPERMFORHOST: `str` = (source)

Undocumented

Value

    '463'

ERR_NOPRIVILEGES: `str` = (source)

Undocumented

Value

    '481'

ERR_NORECIPIENT: `str` = (source)

Undocumented

Value

    '411'

ERR_NOSERVICEHOST: `str` = (source)

Undocumented

Value

    '492'

ERR_NOSUCHCHANNEL: `str` = (source)

Undocumented

Value

    '403'

ERR_NOSUCHNICK: `str` = (source)

Undocumented

Value

    '401'

ERR_NOSUCHSERVER: `str` = (source)

Undocumented

Value

    '402'

ERR_NOSUCHSERVICE: `str` = (source)

Undocumented

Value

    '408'

ERR_NOTEXTTOSEND: `str` = (source)

Undocumented

Value

    '412'

ERR_NOTONCHANNEL: `str` = (source)

Undocumented

Value

    '442'

ERR_NOTOPLEVEL: `str` = (source)

Undocumented

Value

    '413'

ERR_NOTREGISTERED: `str` = (source)

Undocumented

Value

    '451'

ERR_PASSWDMISMATCH: `str` = (source)

Undocumented

Value

    '464'

ERR_RESTRICTED: `str` = (source)

Undocumented

Value

    '484'

ERR_SUMMONDISABLED: `str` = (source)

Undocumented

Value

    '445'

ERR_TOOMANYCHANNELS: `str` = (source)

Undocumented

Value

    '405'

ERR_TOOMANYMATCHES: `str` = (source)

Undocumented

Value

    '416'

ERR_TOOMANYTARGETS: `str` = (source)

Undocumented

Value

    '407'

ERR_UMODEUNKNOWNFLAG: `str` = (source)

Undocumented

Value

    '501'

ERR_UNAVAILRESOURCE: `str` = (source)

Undocumented

Value

    '437'

ERR_UNIQOPPRIVSNEEDED: `str` = (source)

Undocumented

Value

    '485'

ERR_UNKNOWNCOMMAND: `str` = (source)

Undocumented

Value

    '421'

ERR_UNKNOWNMODE: `str` = (source)

Undocumented

Value

    '472'

ERR_USERNOTINCHANNEL: `str` = (source)

Undocumented

Value

    '441'

ERR_USERONCHANNEL: `str` = (source)

Undocumented

Value

    '443'

ERR_USERSDISABLED: `str` = (source)

Undocumented

Value

    '446'

ERR_USERSDONTMATCH: `str` = (source)

Undocumented

Value

    '502'

ERR_WASNOSUCHNICK: `str` = (source)

Undocumented

Value

    '406'

ERR_WILDTOPLEVEL: `str` = (source)

Undocumented

Value

    '414'

ERR_YOUREBANNEDCREEP: `str` = (source)

Undocumented

Value

    '465'

ERR_YOUWILLBEBANNED: `str` = (source)

Undocumented

Value

    '466'

M_QUOTE = (source)

Undocumented

Value

    chr(16)

MAX_COMMAND_LENGTH: `int` = (source)
The maximum length of a command, as defined by RFC 2812 section 2.3.

Value

    512

NL = (source)

Undocumented

Value

    chr(10)

NUL = (source)

Undocumented

Value

    chr(0)

RPL_ADMINEMAIL: `str` = (source)

Undocumented

Value

    '259'

RPL_ADMINLOC1: `str` = (source)

Undocumented

Value

    '257'

RPL_ADMINLOC2: `str` = (source)

Undocumented

Value

    '258'

RPL_ADMINME: `str` = (source)

Undocumented

Value

    '256'

RPL_AWAY: `str` = (source)

Undocumented

Value

    '301'

RPL_BANLIST: `str` = (source)

Undocumented

Value

    '367'

RPL_BOUNCE: `str` = (source)

Undocumented

Value

    '010'

RPL_CHANNELMODEIS: `str` = (source)

Undocumented

Value

    '324'

RPL_CREATED: `str` = (source)

Undocumented

Value

    '003'

RPL_ENDOFBANLIST: `str` = (source)

Undocumented

Value

    '368'

RPL_ENDOFEXCEPTLIST: `str` = (source)

Undocumented

Value

    '349'

RPL_ENDOFINFO: `str` = (source)

Undocumented

Value

    '374'

RPL_ENDOFINVITELIST: `str` = (source)

Undocumented

Value

    '347'

RPL_ENDOFLINKS: `str` = (source)

Undocumented

Value

    '365'

RPL_ENDOFMOTD: `str` = (source)

Undocumented

Value

    '376'

RPL_ENDOFNAMES: `str` = (source)

Undocumented

Value

    '366'

RPL_ENDOFSTATS: `str` = (source)

Undocumented

Value

    '219'

RPL_ENDOFUSERS: `str` = (source)

Undocumented

Value

    '394'

RPL_ENDOFWHO: `str` = (source)

Undocumented

Value

    '315'

RPL_ENDOFWHOIS: `str` = (source)

Undocumented

Value

    '318'

RPL_ENDOFWHOWAS: `str` = (source)

Undocumented

Value

    '369'

RPL_EXCEPTLIST: `str` = (source)

Undocumented

Value

    '348'

RPL_INFO: `str` = (source)

Undocumented

Value

    '371'

RPL_INVITELIST: `str` = (source)

Undocumented

Value

    '346'

RPL_INVITING: `str` = (source)

Undocumented

Value

    '341'

RPL_ISON: `str` = (source)

Undocumented

Value

    '303'

RPL_ISUPPORT: `str` = (source)

Undocumented

Value

    '005'

RPL_LINKS: `str` = (source)

Undocumented

Value

    '364'

RPL_LIST: `str` = (source)

Undocumented

Value

    '322'

RPL_LISTEND: `str` = (source)

Undocumented

Value

    '323'

RPL_LISTSTART: `str` = (source)

Undocumented

Value

    '321'

RPL_LUSERCHANNELS: `str` = (source)

Undocumented

Value

    '254'

RPL_LUSERCLIENT: `str` = (source)

Undocumented

Value

    '251'

RPL_LUSERME: `str` = (source)

Undocumented

Value

    '255'

RPL_LUSEROP: `str` = (source)

Undocumented

Value

    '252'

RPL_LUSERUNKNOWN: `str` = (source)

Undocumented

Value

    '253'

RPL_MOTD: `str` = (source)

Undocumented

Value

    '372'

RPL_MOTDSTART: `str` = (source)

Undocumented

Value

    '375'

RPL_MYINFO: `str` = (source)

Undocumented

Value

    '004'

RPL_NAMREPLY: `str` = (source)

Undocumented

Value

    '353'

RPL_NOTOPIC: `str` = (source)

Undocumented

Value

    '331'

RPL_NOUSERS: `str` = (source)

Undocumented

Value

    '395'

RPL_NOWAWAY: `str` = (source)

Undocumented

Value

    '306'

RPL_REHASHING: `str` = (source)

Undocumented

Value

    '382'

RPL_SERVLIST: `str` = (source)

Undocumented

Value

    '234'

RPL_SERVLISTEND: `str` = (source)

Undocumented

Value

    '235'

RPL_STATSCOMMANDS: `str` = (source)

Undocumented

Value

    '212'

RPL_STATSLINKINFO: `str` = (source)

Undocumented

Value

    '211'

RPL_STATSOLINE: `str` = (source)

Undocumented

Value

    '243'

RPL_STATSUPTIME: `str` = (source)

Undocumented

Value

    '242'

RPL_SUMMONING: `str` = (source)

Undocumented

Value

    '342'

RPL_TIME: `str` = (source)

Undocumented

Value

    '391'

RPL_TOPIC: `str` = (source)

Undocumented

Value

    '332'

RPL_TRACECLASS: `str` = (source)

Undocumented

Value

    '209'

RPL_TRACECONNECTING: `str` = (source)

Undocumented

Value

    '201'

RPL_TRACEEND: `str` = (source)

Undocumented

Value

    '262'

RPL_TRACEHANDSHAKE: `str` = (source)

Undocumented

Value

    '202'

RPL_TRACELINK: `str` = (source)

Undocumented

Value

    '200'

RPL_TRACELOG: `str` = (source)

Undocumented

Value

    '261'

RPL_TRACENEWTYPE: `str` = (source)

Undocumented

Value

    '208'

RPL_TRACEOPERATOR: `str` = (source)

Undocumented

Value

    '204'

RPL_TRACERECONNECT: `str` = (source)

Undocumented

Value

    '210'

RPL_TRACESERVER: `str` = (source)

Undocumented

Value

    '206'

RPL_TRACESERVICE: `str` = (source)

Undocumented

Value

    '207'

RPL_TRACEUNKNOWN: `str` = (source)

Undocumented

Value

    '203'

RPL_TRACEUSER: `str` = (source)

Undocumented

Value

    '205'

RPL_TRYAGAIN: `str` = (source)

Undocumented

Value

    '263'

RPL_UMODEIS: `str` = (source)

Undocumented

Value

    '221'

RPL_UNAWAY: `str` = (source)

Undocumented

Value

    '305'

RPL_UNIQOPIS: `str` = (source)

Undocumented

Value

    '325'

RPL_USERHOST: `str` = (source)

Undocumented

Value

    '302'

RPL_USERS: `str` = (source)

Undocumented

Value

    '393'

RPL_USERSSTART: `str` = (source)

Undocumented

Value

    '392'

RPL_VERSION: `str` = (source)

Undocumented

Value

    '351'

RPL_WELCOME: `str` = (source)

Undocumented

Value

    '001'

RPL_WHOISCHANNELS: `str` = (source)

Undocumented

Value

    '319'

RPL_WHOISIDLE: `str` = (source)

Undocumented

Value

    '317'

RPL_WHOISOPERATOR: `str` = (source)

Undocumented

Value

    '313'

RPL_WHOISSERVER: `str` = (source)

Undocumented

Value

    '312'

RPL_WHOISUSER: `str` = (source)

Undocumented

Value

    '311'

RPL_WHOREPLY: `str` = (source)

Undocumented

Value

    '352'

RPL_WHOWASUSER: `str` = (source)

Undocumented

Value

    '314'

RPL_YOUREOPER: `str` = (source)

Undocumented

Value

    '381'

RPL_YOURESERVICE: `str` = (source)

Undocumented

Value

    '383'

RPL_YOURHOST: `str` = (source)

Undocumented

Value

    '002'

SPC = (source)

Undocumented

Value

    chr(32)

X_DELIM = (source)

Undocumented

Value

    chr(1)

X_QUOTE: `str` = (source)

Undocumented

Value

    '\\'

attributes = (source)
Singleton instance of `_CharacterAttributes`, used for constructing formatted text information.
mDequoteTable: `dict` = (source)

Undocumented

mEscape_re = (source)

Undocumented

mQuoteTable = (source)

Undocumented

numeric_to_symbolic: `dict` = (source)

Undocumented

symbolic_to_numeric: `dict[str, str]` = (source)

Undocumented

xDequoteTable: `dict` = (source)

Undocumented

xEscape_re = (source)

Undocumented

xQuoteTable = (source)

Undocumented

def _foldr(f, z, xs): (source)
Apply a function of two arguments cumulatively to the items of a sequence, from right to left, so as to reduce the sequence to a single value.

Parameters
f:`callable` taking 2 arguments | Undocumented
z | Initial value.
xs | Sequence to reduce.
Returns
Single value resulting from reducing `xs`.

def _intOrDefault(value, default=None): (source)
Convert a value to an integer if possible.

Returns
`int` or type of `default` | An integer when `value` can be converted to an integer, otherwise return `default`

_BOLD: `str` = (source)

Undocumented

Value

    '\x02'

_COLOR: `str` = (source)

Undocumented

Value

    '\x03'

_IRC_COLOR_NAMES = (source)

Undocumented

Value

    {code: name for name, code in _IRC_COLORS.items()}

_IRC_COLORS = (source)

Undocumented

Value

    dict(zip(['white',
              'black',
              'blue',
              'green',
              'lightRed',
              'red',
              'magenta',
    ...

_OFF: `str` = (source)

Undocumented

Value

    '\x0f'

_REVERSE_VIDEO: `str` = (source)

Undocumented

Value

    '\x16'

_UNDERLINE: `str` = (source)

Undocumented

Value

    '\x1f'