diff options
author | Julien Dessaux | 2010-01-22 18:45:20 +0100 |
---|---|---|
committer | Julien Dessaux | 2010-02-04 20:57:10 +0100 |
commit | 047a10bc9b9ef348ab57cbb58c6940a0858c38ac (patch) | |
tree | 3c83df8f556c400d855da6e539b3c11f52457b79 | |
parent | Rewrote command handling, added the Quote module and cleaned input handling. (diff) | |
download | hsbot-047a10bc9b9ef348ab57cbb58c6940a0858c38ac.tar.gz hsbot-047a10bc9b9ef348ab57cbb58c6940a0858c38ac.tar.bz2 hsbot-047a10bc9b9ef348ab57cbb58c6940a0858c38ac.zip |
Fixed some types' functions.
-rw-r--r-- | Config.hs | 6 | ||||
-rw-r--r-- | Hsbot/Core.hs | 4 | ||||
-rw-r--r-- | Hsbot/IRC.hs | 2 | ||||
-rw-r--r-- | Hsbot/Types.hs | 6 |
4 files changed, 9 insertions, 9 deletions
@@ -14,9 +14,9 @@ defaultPlugins = [ "Ping", "Quote" ] -- | User server kro :: IrcServer kro = IrcServer - { address = "kro.corp" - , port = PortNumber 6667 - , channels = ["#shbot"] + { serverAddress = "perseus" + , serverPort = PortNumber 6667 + , joinChannels = ["#shbot"] , nickname = "hsbot" , password = "" , realname = "The One True bot, with it's haskell soul." diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index 546358b..40e8e59 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -20,10 +20,10 @@ import Hsbot.Utils -- Connect to the server and return the initial bot state connectServer :: IrcServer -> IO Bot connectServer server = do - let name = address server + let name = serverAddress server starttime <- getClockTime putStr $ "Connecting to " ++ name ++ "... " - handle <- connectTo name $ port server + handle <- connectTo name $ serverPort server hSetBuffering handle NoBuffering putStrLn "done." putStr $ "Opening server communication channel... " diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs index a489ee9..c837a4f 100644 --- a/Hsbot/IRC.hs +++ b/Hsbot/IRC.hs @@ -19,7 +19,7 @@ initServer = do 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)] - mapM_ joinChan (channels server) + mapM_ joinChan (joinChannels server) -- | Run a server runServer :: IrcBot () diff --git a/Hsbot/Types.hs b/Hsbot/Types.hs index 25a7732..4e002db 100644 --- a/Hsbot/Types.hs +++ b/Hsbot/Types.hs @@ -29,9 +29,9 @@ data Config = Config -- | An IRC server data IrcServer = IrcServer - { address :: String -- the server's address - , port :: PortID -- the server's port - , channels :: [String] -- a list of channels to join + { serverAddress :: String -- the server's address + , serverPort :: PortID -- the server's port + , joinChannels :: [String] -- a list of channels to join , nickname :: String -- the hsbot's nickname , password :: String -- the hsbot's password, optional , realname :: String -- the hsbot's real name, optional |