Archived
1
0
Fork 0

Some refactoring + cosmetics.

This commit is contained in:
Julien Dessaux 2010-04-25 16:43:01 +02:00
parent 727adadc28
commit b6d119cf5b
13 changed files with 71 additions and 63 deletions

View file

@ -29,9 +29,9 @@ type QuoteBot a = StateT QuoteDB IO a
-- | The plugin's main entry point
mainQuote :: Chan BotMsg -> Chan BotMsg -> IO ()
mainQuote serverChan chan = do
let plugin = PluginInstance "Quote" serverChan chan
let plugin = PluginState "Quote" serverChan chan
evalStateT (mapM_ sendRegisterCommand ["quote"]) plugin
(execStateT run plugin) `catch` (\(ex :: AsyncException) -> return plugin)
_ <- (evalStateT (run quoteBot) plugin) `catch` (\(_ :: AsyncException) -> return quoteBot)
evalStateT (mapM_ sendUnregisterCommand ["quote"]) plugin
-- | The IrcPlugin monad main function