diff options
author | Julien Dessaux | 2010-04-25 16:43:01 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-04-25 16:43:01 +0200 |
commit | b6d119cf5b14fd7198552e939d8f49b15307e74e (patch) | |
tree | 1f2188a89b159d6800ff89ed3346437aebfb2782 /Plugins/Quote.hs | |
parent | Added an utility function to correctly answer a message we receive (aka /msg) (diff) | |
download | hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.gz hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.tar.bz2 hsbot-b6d119cf5b14fd7198552e939d8f49b15307e74e.zip |
Some refactoring + cosmetics.
Diffstat (limited to 'Plugins/Quote.hs')
-rw-r--r-- | Plugins/Quote.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 |