Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides functions for constructing outgoing IRC messages from the client to the server.
Note: These functions add the required trailing newline characters.
- passCmd :: ByteString -> ByteString
- nickCmd :: Identifier -> ByteString
- userCmd :: ByteString -> ByteString -> ByteString
- operCmd :: ByteString -> ByteString -> ByteString
- modeCmd :: Identifier -> [ByteString] -> ByteString
- quitCmd :: ByteString -> ByteString
- joinCmd :: Identifier -> Maybe ByteString -> ByteString
- partCmd :: Identifier -> ByteString -> ByteString
- topicCmd :: Identifier -> ByteString -> ByteString
- namesCmd :: [Identifier] -> ByteString
- listCmd :: [Identifier] -> ByteString
- inviteCmd :: Identifier -> Identifier -> ByteString
- kickCmd :: Identifier -> Identifier -> ByteString -> ByteString
- privMsgCmd :: Identifier -> ByteString -> ByteString
- ctcpRequestCmd :: Identifier -> ByteString -> ByteString -> ByteString
- ctcpResponseCmd :: Identifier -> ByteString -> ByteString -> ByteString
- noticeCmd :: Identifier -> ByteString -> ByteString
- whoisCmd :: Identifier -> ByteString
- whowasCmd :: Identifier -> ByteString
- whoCmd :: ByteString -> ByteString
- pongCmd :: ByteString -> ByteString
- pingCmd :: ByteString -> ByteString
- capLsCmd :: ByteString
- capReqCmd :: [ByteString] -> ByteString
- capEndCmd :: ByteString
- authenticateCmd :: ByteString -> ByteString
- awayCmd :: ByteString -> ByteString
- helpCmd :: ByteString -> ByteString
- removeCmd :: Identifier -> Identifier -> ByteString -> ByteString
- knockCmd :: Identifier -> ByteString
- acceptCmd :: ByteString -> ByteString
- timeCmd :: Maybe ByteString -> ByteString
- adminCmd :: Maybe ByteString -> ByteString
- statsCmd :: Char -> Maybe ByteString -> ByteString
Documentation
:: ByteString | password |
-> ByteString |
Construct a PASS command. This is used in the initial handshake to specify a password for the connection.
PASS password
:: Identifier | nickname |
-> ByteString |
Construct a NICK command. This is used to specify the initial nickname as well as to change it.
NICK nickname
:: ByteString | username |
-> ByteString | realname |
-> ByteString |
Construct a USER command. This is used in the initial handshake to specify username and realname.
USER username 0 * realname
:: ByteString | name |
-> ByteString | password |
-> ByteString |
:: Identifier | target |
-> [ByteString] | modes and params |
-> ByteString |
Construct a MODE command
MODE target *(mode) *(modeparams)
joinCmd :: Identifier -> Maybe ByteString -> ByteString Source #
Construct a JOIN command. A join command can support multiple channels separated by commas, and takes an optional channel key.
JOIN channel [key]
:: Identifier | channel |
-> ByteString | message |
-> ByteString |
Construct a PART command.
PART channel message
:: Identifier | channel |
-> ByteString | topic |
-> ByteString |
Construct a TOPIC command. This is used to lookup the current topic or to change it.
TOPIC channel message
:: [Identifier] | channels |
-> ByteString |
:: [Identifier] | channels |
-> ByteString |
:: Identifier | nickname |
-> Identifier | channel |
-> ByteString |
:: Identifier | channel |
-> Identifier | nick |
-> ByteString | msg |
-> ByteString |
Construct a KICK command
@KICK channel nick msg
:: Identifier | target |
-> ByteString | message |
-> ByteString |
Construct a PRIVMSG command. This send normal chat messages to both users as well as channels.
PRIVMSG target message
:: Identifier | target |
-> ByteString | command |
-> ByteString | parameters |
-> ByteString |
:: Identifier | target |
-> ByteString | command |
-> ByteString | parameters |
-> ByteString |
:: Identifier | target |
-> ByteString | message |
-> ByteString |
Construct a NOTICE command. This send notice chat messages to both users as well as channels.
NOTICE target message
:: ByteString | token |
-> ByteString |
Construct a PONG command. This is used to respond to the PING command to keep a connection alive.
PONG token
:: ByteString | token |
-> ByteString |
Construct a PING command. This is used to respond to the PING command to keep a connection alive.
PONG token
capLsCmd :: ByteString Source #
Construct a CAP LS command. This is used during the inital connection to request a list of extensions that are supported by the server. It should be followed by CAP REQ and eventually CAP END commands.
CAP LS
capReqCmd :: [ByteString] -> ByteString Source #
Construct a CAP REQ command. This is used to request a subset of the capabilities returned in response to a CAP LS command.
CAP REQ :cap0 cap1 .. capN
capEndCmd :: ByteString Source #
Construct a CAP END command. This terminates the capability negotiation portion of the initial connection.
CAP END
:: ByteString | message |
-> ByteString |
Construct an AUTHENTICATE command.
AUTHENTICATE message
:: Identifier | channel |
-> Identifier | nick |
-> ByteString | msg |
-> ByteString |
Construct a REMOVE command
@REMOVE channel nick msg
:: Char | |
-> Maybe ByteString | target |
-> ByteString |