Fixed several stuff.
This commit is contained in:
parent
bfc06f1ff1
commit
4c76d3d40b
10 changed files with 25 additions and 21 deletions
|
@ -2,7 +2,7 @@ module Plugins.Core
|
|||
( mainCore
|
||||
) where
|
||||
|
||||
import Control.Concurrent.Chan
|
||||
import Control.Concurrent.Chan(Chan)
|
||||
import Control.Exception
|
||||
import Control.Monad.State
|
||||
import Prelude hiding (catch)
|
||||
|
@ -16,8 +16,8 @@ mainCore :: Chan BotMsg -> Chan BotMsg -> IO ()
|
|||
mainCore serverChan chan = do
|
||||
let plugin = PluginInstance "Core" serverChan chan
|
||||
evalStateT (mapM_ sendRegisterCommand ["list", "load", "reload", "unload"]) plugin
|
||||
(execStateT run plugin) `catch` (\(ex :: AsyncException) -> return plugin)
|
||||
evalStateT (mapM_ sendUnregisterCommand ["list", "load", "reload", "unload"]) plugin
|
||||
plugin' <- (execStateT run plugin) `catch` (\(_ :: AsyncException) -> return plugin)
|
||||
evalStateT (mapM_ sendUnregisterCommand ["list", "load", "reload", "unload"]) plugin'
|
||||
|
||||
-- | The IrcPlugin monad main function
|
||||
run :: IrcPlugin ()
|
||||
|
|
|
@ -14,7 +14,7 @@ import Hsbot.Types
|
|||
mainPing :: Chan BotMsg -> Chan BotMsg -> IO ()
|
||||
mainPing serverChan chan = do
|
||||
let plugin = PluginInstance "Ping" serverChan chan
|
||||
(execStateT run plugin) `catch` (\(ex :: AsyncException) -> return plugin)
|
||||
_ <- (execStateT run plugin) `catch` (\(_ :: AsyncException) -> return plugin)
|
||||
return ()
|
||||
|
||||
-- | The IrcPlugin monad main function
|
||||
|
|
Reference in a new issue