blob: 3cb0ce5c34b2e596c0715a4bb8110411c9616e9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
module Hsbot.Main
( imain
) where
import Control.Monad.State
import System.IO
import Config
import Hsbot.Core
import Hsbot.IRC
import Hsbot.Plugin
-- | Bot's main entry point
imain :: IO ()
imain = do
bot <- connectServer $ ircServer config
(runStateT run bot) `catch` (const $ return ((), bot))
disconnectServer bot
-- | The Bot monad main function
run :: IrcBot ()
run = do
initServer
mapM_ loadPlugin defaultPlugins
runServer
|