Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.IRC.Fun.Client.Events
Description
This module allows you to identify IRC events. Events are a wrapper around IRC messages, which provide a logical layer convenient to work with (while IRC messages have their lower level aspects, being plain protocol messages).
- data Event
- = Ping String (Maybe String)
- | Kick String [String] (Maybe String)
- | Join String String
- | Part String String (Maybe String)
- | Quit String (Maybe String)
- | Mode
- | ChannelMessage String String String Bool
- | PrivateMessage String String Bool
- | Topic String String String
- | Invite String String
- | Names ChannelPrivacy String [(Privilege, String)]
- | OtherEvent String
- data ChannelPrivacy :: *
- data Privilege :: *
- detectEvents :: Either SpecificReply SpecificMessage -> Either String [Event]
- hGetIrcEventsOnce :: Handle -> IO (Maybe [Event])
- hGetIrcEvents :: Handle -> IO [Event]
Documentation
An event triggered by an IRC message sent from the server.
Constructors
Ping String (Maybe String) | A ping was sent to the bot. The parameters are the server name and optionally a server to forward the response to. They can be passed as-is directly to the PONG response. |
Kick String [String] (Maybe String) | One or more users have been kicked from a channel for an optionally given reason. Parameters: Channel, nicknames, reason. |
Join String String | A user joined a channel. Parameters: Channel, nickname. |
Part String String (Maybe String) | A user left a channel, optionally with a given reason. Parameters: Channel, nickname, reason. |
Quit String (Maybe String) | A user left the network, optonally for the given reason. Parameters: Nickname, reason. |
Mode | TODO |
ChannelMessage String String String Bool | Message sent in a channel by a user. The last parameter indicates whether the message is actually a notice. If yes, the client shouldn't automatically send a response. Parameters: Channel, nickname, message, whether notice. |
PrivateMessage String String Bool | A private message sent specifically to the client from a user. The last parameter indicates whether the message is actually a notice. If yes, the client shouldn't send any automatic response. Parameters: Nickname, message, whether notice. |
Topic String String String | Channel topic change. Parameterss: Channel, nickname of user who changed the topic, new topic content. |
Invite String String | The client has been invited to a channel by another user. Parameters: Channel, nickname of inviting user. |
Names ChannelPrivacy String [(Privilege, String)] | The server sent a list of nicknames present in a channel. Parameters: Channel privacy mode, channel name, list of users. Each list item is a pair of a user privilege level in the channel, and the user's nickname. |
OtherEvent String |
data ChannelPrivacy :: *
Instances
hGetIrcEventsOnce :: Handle -> IO (Maybe [Event]) Source
Receive IRC events. If parsing and detecting the events fails, Nothing
is returned.
hGetIrcEvents :: Handle -> IO [Event] Source
Receive the next valid (successfully parsed and detected) series of IRC events.