ソースを参照

Adds travis badge. Reformats example code.

Abhinav Sarkar 5年前
コミット
7130fd21c8
1個のファイルの変更15行の追加11行の削除
  1. 15
    11
      README.md

+ 15
- 11
README.md ファイルの表示

@@ -1,7 +1,9 @@
1 1
 #Hircarra
2 2
 
3
+[![Build Status](https://travis-ci.org/abhin4v/hask-irc.svg?branch=master)](https://travis-ci.org/abhin4v/hask-irc)
4
+
3 5
 > hircarra (plural hircarras)
4
-> 
6
+>
5 7
 > (historical, India) A messenger, especially one who delivers a personal message.
6 8
 
7 9
 Hircarra is a Haskell library to write [IRC][1] bots. It is meant to be very easy to use and completely extensible. It provides a core on which users can add support for their own IRC messages and replies and handlers. It also comes with a set of handlers (in the hircarra-handlers package) which provide a varied set of functionalities.
@@ -69,7 +71,7 @@ Core features:
69 71
 Let's write a simple echo handler:
70 72
 
71 73
 ```
72
-$ ghci -package-db=./.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d            
74
+$ ghci -package-db=./.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d
73 75
 GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
74 76
 Loading package ghc-prim ... linking ... done.
75 77
 Loading package integer-gmp ... linking ... done.
@@ -83,13 +85,15 @@ Prelude> :set prompt  "λ: "
83 85
 λ|   onMessage = \ Message { message = message } ->
84 86
 λ|     case fromMessage message of
85 87
 λ|       Just (ChannelMsg _ msg) -> do
86
-λ|         reply <- newMessage (ChannelMsgReply msg)
88
+λ|         reply <- newMessage $ ChannelMsgReply msg
87 89
 λ|         return [reply]
88 90
 λ|       _ -> return []
89 91
 λ| }
90 92
 λ|
91 93
 λ> let botConfig = newBotConfig "irc.freenode.net" 6667 "#hircarra" (Nick "hibot") 130 DEBUG
92
-λ> let botConfigWithHandler = botConfig { msgHandlerMakers = singleton "echo" echoHandler, msgHandlerInfo = singleton "echo" empty }
94
+λ> let botConfigWithHandler = botConfig {
95
+                                msgHandlerMakers = singleton "echo" echoHandler,
96
+                                msgHandlerInfo = singleton "echo" empty }
93 97
 λ|
94 98
 λ> runBot botConfigWithHandler
95 99
 [2015-06-29 18:28:43] Network.IRC.Client DEBUG Connecting ...
@@ -134,12 +138,12 @@ handlers = ["echo","help","pingpong"] }
134 138
 Here is how the conversation looked in an IRC client:
135 139
 
136 140
 ```
137
-[23:58:56] 	hibot (~hibot@106.51.139.38) joined the channel
138
-[23:58:59]  <@abh>	test test
139
-[23:59:00]  <hibot>	test test
140
-[23:59:05]  <@abh>	repeater
141
-[23:59:06]  <hibot>	repeater
142
-[23:59:11] 	hibot (~hibot@106.51.139.38) left IRC (Client Quit)
141
+[18:28:56] 	hibot (~hibot@106.51.139.38) joined the channel
142
+[18:28:59]  <@abh>	test test
143
+[18:29:00]  <hibot>	test test
144
+[18:29:05]  <@abh>	repeater
145
+[18:29:06]  <hibot>	repeater
146
+[18:29:11] 	hibot (~hibot@106.51.139.38) left IRC (Client Quit)
143 147
 ```
144 148
 
145
-[1]: https://en.wikipedia.org/wiki/Irc
149
+[1]: https://en.wikipedia.org/wiki/Irc

読み込み中…
キャンセル
保存