Adds travis badge. Reformats example code.

master
Abhinav Sarkar 2015-09-07 23:27:02 +05:30
parent fd3932daad
commit 7130fd21c8
1 changed files with 15 additions and 11 deletions

View File

@ -1,5 +1,7 @@
#Hircarra
[![Build Status](https://travis-ci.org/abhin4v/hask-irc.svg?branch=master)](https://travis-ci.org/abhin4v/hask-irc)
> hircarra (plural hircarras)
>
> (historical, India) A messenger, especially one who delivers a personal message.
@ -83,13 +85,15 @@ Prelude> :set prompt "λ: "
λ| onMessage = \ Message { message = message } ->
λ| case fromMessage message of
λ| Just (ChannelMsg _ msg) -> do
λ| reply <- newMessage (ChannelMsgReply msg)
λ| reply <- newMessage $ ChannelMsgReply msg
λ| return [reply]
λ| _ -> return []
λ| }
λ|
λ> let botConfig = newBotConfig "irc.freenode.net" 6667 "#hircarra" (Nick "hibot") 130 DEBUG
λ> let botConfigWithHandler = botConfig { msgHandlerMakers = singleton "echo" echoHandler, msgHandlerInfo = singleton "echo" empty }
λ> let botConfigWithHandler = botConfig {
msgHandlerMakers = singleton "echo" echoHandler,
msgHandlerInfo = singleton "echo" empty }
λ|
λ> runBot botConfigWithHandler
[2015-06-29 18:28:43] Network.IRC.Client DEBUG Connecting ...
@ -134,12 +138,12 @@ handlers = ["echo","help","pingpong"] }
Here is how the conversation looked in an IRC client:
```
[23:58:56] hibot (~hibot@106.51.139.38) joined the channel
[23:58:59] <@abh> test test
[23:59:00] <hibot> test test
[23:59:05] <@abh> repeater
[23:59:06] <hibot> repeater
[23:59:11] hibot (~hibot@106.51.139.38) left IRC (Client Quit)
[18:28:56] hibot (~hibot@106.51.139.38) joined the channel
[18:28:59] <@abh> test test
[18:29:00] <hibot> test test
[18:29:05] <@abh> repeater
[18:29:06] <hibot> repeater
[18:29:11] hibot (~hibot@106.51.139.38) left IRC (Client Quit)
```
[1]: https://en.wikipedia.org/wiki/Irc