summaryrefslogtreecommitdiff
path: root/Hsbot/IRC.hs
diff options
context:
space:
mode:
authorJulien Dessaux2010-04-25 16:43:01 +0200
committerJulien Dessaux2010-04-25 16:43:01 +0200
commitb6d119cf5b14fd7198552e939d8f49b15307e74e (patch)
tree1f2188a89b159d6800ff89ed3346437aebfb2782 /Hsbot/IRC.hs
parentAdded an utility function to correctly answer a message we receive (aka /msg) (diff)
downloadhsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.gz
hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.bz2
hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.zip
Some refactoring + cosmetics.
Diffstat (limited to 'Hsbot/IRC.hs')
-rw-r--r--Hsbot/IRC.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs
index 1eac2d8..4a0e5f8 100644
--- a/Hsbot/IRC.hs
+++ b/Hsbot/IRC.hs
@@ -15,10 +15,10 @@ import Hsbot.Utils
initServer :: IrcBot ()
initServer = do
server <- gets serverConfig
- sendstr $ serializeIrcMsg $ IrcMsg Nothing "NICK" [(nickname server)]
- sendstr $ serializeIrcMsg $ IrcMsg Nothing "USER" [(nickname server), "0", "*", (realname server)]
+ sendstr . serializeIrcMsg $ IrcMsg Nothing "NICK" [(nickname server)]
+ sendstr . serializeIrcMsg $ IrcMsg Nothing "USER" [(nickname server), "0", "*", (realname server)]
when (not . null $ password server) $ do
- sendstr $ serializeIrcMsg $ IrcMsg Nothing "PRIVMSG" ["nickserv", "identify", (password server)]
+ sendstr . serializeIrcMsg $ IrcMsg Nothing "PRIVMSG" ["nickserv", "identify", (password server)]
mapM_ joinChan (joinChannels server)
-- | Run a server
@@ -40,6 +40,6 @@ joinChan name = do
newChannel = Channel name
(nickname $ serverConfig bot)
(administrators $ serverConfig bot)
- sendstr $ serializeIrcMsg $ IrcMsg Nothing "JOIN" [name]
+ sendstr . serializeIrcMsg $ IrcMsg Nothing "JOIN" [name]
put $ bot { chans = newChannel : oldChannels }