diff options
author | Julien Dessaux | 2011-08-08 20:56:20 +0200 |
---|---|---|
committer | Julien Dessaux | 2011-08-08 20:58:34 +0200 |
commit | 3b914c1b7729f52ba96e51ad43424909acae681c (patch) | |
tree | bc4f81ee8af1abea9cd2aef1471f288721b8f088 /Hsbot/Plugin | |
parent | Added Administrative plugin that will permit dynamic reloading (diff) | |
download | hsbot-3b914c1b7729f52ba96e51ad43424909acae681c.tar.gz hsbot-3b914c1b7729f52ba96e51ad43424909acae681c.tar.bz2 hsbot-3b914c1b7729f52ba96e51ad43424909acae681c.zip |
Added exception handling, an autorestart when that happens and output in case of restart/reload
Diffstat (limited to 'Hsbot/Plugin')
-rw-r--r-- | Hsbot/Plugin/Admin.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Hsbot/Plugin/Admin.hs b/Hsbot/Plugin/Admin.hs index 7dba362..cbec152 100644 --- a/Hsbot/Plugin/Admin.hs +++ b/Hsbot/Plugin/Admin.hs @@ -33,11 +33,11 @@ theAdmin = forever $ readMsg >>= eval else answerMsg msg "Only admins can do that." "restart":"help":_ -> answerMsg msg "restart hsbot, reset the running state to config file directives." "restart":_ -> lift (hasAccess (IRC.msg_prefix msg) Admin) >>= \right -> if right - then lift $ setGlobalQuitMVar BotRestart + then lift . setGlobalQuitMVar $ BotRestart (getSender msg ++ " request", Nothing) else answerMsg msg "Only admins can do that." "reload":"help":_ -> answerMsg msg "reload hsbot, and try merge the new config file directives with actual running state)." "reload":_ -> lift (hasAccess (IRC.msg_prefix msg) Admin) >>= \right -> if right - then lift $ setGlobalQuitMVar BotReload + then lift . setGlobalQuitMVar . BotReload $ getSender msg ++ " request" else answerMsg msg "Only admins can do that." _ -> return () | otherwise = return () |