diff options
Diffstat (limited to '')
-rw-r--r-- | Hsbot/Core.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index b0efc03..621e670 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -7,6 +7,7 @@ import Control.Concurrent import Control.Concurrent.Chan import Control.Monad.State import Data.List +import qualified Data.Map as M import Network import System.IO import System.Time (getClockTime) @@ -28,13 +29,13 @@ connectServer server = do chan <- newChan :: IO (Chan BotMsg) threadId <- forkIO $ botReader handle chan putStrLn "done." - return (Bot server starttime handle [] [] chan threadId) + return (Bot server starttime handle [] M.empty chan threadId M.empty) -- | Disconnect from the server disconnectServer :: Bot -> IO () -- IO Bot ? disconnectServer bot = do killThread $ readerThreadId bot - mapM_ (killThread . pluginThreadId) (botPlugins bot) + mapM_ (killThread . pluginThreadId . snd) (M.toList $ botPlugins bot) hClose $ botHandle bot return () |