| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.IRC.Client.Handlers
Contents
Description
The default event handlers. Handlers are invoked concurrently when matching events are received from the server.
- defaultEventHandlers :: [EventHandler s]
- pingHandler :: UnicodeEvent -> StatefulIRC s ()
- ctcpPingHandler :: UnicodeEvent -> StatefulIRC s ()
- ctcpVersionHandler :: UnicodeEvent -> StatefulIRC s ()
- ctcpTimeHandler :: UnicodeEvent -> StatefulIRC s ()
- welcomeNick :: UnicodeEvent -> StatefulIRC s ()
- joinOnWelcome :: UnicodeEvent -> StatefulIRC s ()
- nickMangler :: UnicodeEvent -> StatefulIRC s ()
- defaultOnConnect :: StatefulIRC s ()
- defaultOnDisconnect :: StatefulIRC s ()
Event handlers
defaultEventHandlers :: [EventHandler s] 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 -> StatefulIRC s () Source #
Respond to server PING messages with a PONG.
ctcpPingHandler :: UnicodeEvent -> StatefulIRC s () Source #
Respond to CTCP PING requests with a CTCP PONG.
ctcpVersionHandler :: UnicodeEvent -> StatefulIRC s () Source #
Respond to CTCP VERSION requests with the version string.
ctcpTimeHandler :: UnicodeEvent -> StatefulIRC s () Source #
Respond to CTCP TIME requests with the system time.
welcomeNick :: UnicodeEvent -> StatefulIRC s () 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).
joinOnWelcome :: UnicodeEvent -> StatefulIRC s () Source #
Join default channels upon welcome (numeric reply 001). If sent earlier, the server might reject the JOIN attempts.
nickMangler :: UnicodeEvent -> StatefulIRC s () Source #
Mangle the nick if there's a collision (numeric replies 432, 433, and 436) when we set it
Special handlers
defaultOnConnect :: StatefulIRC s () Source #
The default connect handler: set the nick.
defaultOnDisconnect :: StatefulIRC s () Source #
The default disconnect handler: do nothing. You might want to override this with one which reconnects.