fastirc-0.1.2: Fast Internet Relay Chat (IRC) library

Stabilityexperimental
MaintainerErtugrul Soeylemez

Network.FastIRC.Messages

Contents

Description

Parser and printer for IRC messages.

Synopsis

IRC messages

data Message Source

Data type for IRC messages.

Constructors

Message 

Fields

msgOrigin :: !(Maybe UserSpec)

Message origin (user/server).

msgCommand :: !Command

Message command or numeric.

Instances

messageParser :: ServerSet -> Parser MessageSource

Parser for IRC messages.

showMessage :: Message -> MsgStringSource

Turn a Message into a ByteString. It will already contain "\r\n" and can be sent as is to the IRC server.

IRC commands

data Command Source

Data type for IRC commands.

Constructors

StringCmd CommandName [CommandArg]

Arbitrary string command.

NumericCmd Integer [CommandArg]

Arbitrary numeric command.

JoinCmd (Map ChannelName (Maybe ChannelKey))

Join command with a list of channels as well as channel keys.

Instances

commandParser :: Parser CommandSource

Parser for IRC commands and their arguments.

showCommand :: Command -> MsgStringSource

Turn a Command into a ByteString. Please note that a command does not contain an origin specification. You should use showMessage to format a an IRC message to be sent to the server.