| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.IRC.Client.Handlers
Description
The default event handlers. Handlers are invoked concurrently when matching events are received from the server.
- defaultEventHandlers :: [EventHandler]
- pingHandler :: UnicodeEvent -> IRC ()
- ctcpPingHandler :: UnicodeEvent -> IRC ()
- ctcpVersionHandler :: UnicodeEvent -> IRC ()
- ctcpTimeHandler :: UnicodeEvent -> IRC ()
- welcomeNick :: UnicodeEvent -> IRC ()
- nickMangler :: UnicodeEvent -> IRC ()
- defaultDisconnectHandler :: IRC ()
Event handlers
defaultEventHandlers :: [EventHandler] Source
The default event handlers, the following are included:
- respond to server
PINGmessages with aPONG; - respond to CTCP
PINGrequests with a CTCPPONG; - respond to CTCP
VERSIONrequests with the version string; - respond to CTCP
TIMErequests with the system time; - update the nick upon receiving the welcome message, in case the server modifies it;
- mangle the nick if the server reports a collision;
- update the channel list on
JOINandKICK.
These event handlers are all exposed through the
Network.IRC.Client.Handlers module, so you can use them directly if
you are building up your InstanceConfig from scratch.
If you are building a bot, you may want to write an event handler to process messages representing commands.
pingHandler :: UnicodeEvent -> IRC () Source
Respond to server PING messages with a PONG.
ctcpPingHandler :: UnicodeEvent -> IRC () Source
Respond to CTCP PING requests with a CTCP PONG.
ctcpVersionHandler :: UnicodeEvent -> IRC () Source
Respond to CTCP VERSION requests with the version string.
ctcpTimeHandler :: UnicodeEvent -> IRC () Source
Respond to CTCP TIME requests with the system time.
welcomeNick :: UnicodeEvent -> IRC () Source
Update the nick upon welcome (numeric reply 001), as it may not be what we requested (eg, in the case of a nick too long).
nickMangler :: UnicodeEvent -> IRC () Source
Mangle the nick if there's a collision (numeric replies 432, 433, and 436) when we set it
Disconnect handlers
defaultDisconnectHandler :: IRC () Source
The default disconnect handler: do nothing. You might want to override this with one which reconnects.