From b6d119cf5b14fd7198552e939d8f49b15307e74e Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 25 Apr 2010 16:43:01 +0200 Subject: Some refactoring + cosmetics. --- Plugins/Quote.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Plugins/Quote.hs') diff --git a/Plugins/Quote.hs b/Plugins/Quote.hs index df16006..db473f9 100644 --- a/Plugins/Quote.hs +++ b/Plugins/Quote.hs @@ -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 -- cgit v1.2.3