diff options
author | Julien Dessaux | 2010-04-25 16:43:01 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-04-25 16:43:01 +0200 |
commit | b6d119cf5b14fd7198552e939d8f49b15307e74e (patch) | |
tree | 1f2188a89b159d6800ff89ed3346437aebfb2782 /Hsbot/IRC.hs | |
parent | Added an utility function to correctly answer a message we receive (aka /msg) (diff) | |
download | hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.gz hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.bz2 hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.zip |
Some refactoring + cosmetics.
Diffstat (limited to '')
-rw-r--r-- | Hsbot/IRC.hs | 8 |
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 } |