Safe Haskell | Safe-Inferred |
---|
Datatypes for representing IRC messages, as well as formatting them.
- type Parameter = ByteString
- type ServerName = ByteString
- type UserName = ByteString
- type RealName = ByteString
- type Command = ByteString
- data Prefix
- data Message = Message {
- msg_prefix :: Maybe Prefix
- msg_command :: Command
- msg_params :: [Parameter]
- encode :: Message -> ByteString
- showMessage :: Message -> ByteString
- showPrefix :: Prefix -> ByteString
- showParameters :: [Parameter] -> ByteString
- translateReply :: Command -> ByteString
- replyTable :: [(ByteString, ByteString)]
- render :: Message -> ByteString
Type Synonyms
type Parameter = ByteStringSource
type ServerName = ByteStringSource
type UserName = ByteStringSource
type RealName = ByteStringSource
type Command = ByteStringSource
IRC Datatypes
The optional beginning of an IRC messages
Server ServerName | Server Prefix |
NickName ByteString (Maybe UserName) (Maybe ServerName) | Nickname Prefix |
IRC messages are parsed as:
[ :
prefix space ] command { space param } crlf
Message | |
|
Formatting functions
encode :: Message -> ByteStringSource
Encode a message to its string representation
showPrefix :: Prefix -> ByteStringSource
showParameters :: [Parameter] -> ByteStringSource
:: Command | Reply |
-> ByteString | Text translation |
Translate a reply into its text description. If no text is available, the argument is returned.
replyTable :: [(ByteString, ByteString)]Source
Deprecated
render :: Message -> ByteStringSource
This is the deprecated version of encode