summaryrefslogtreecommitdiff
path: root/Hsbot/Plugin
diff options
context:
space:
mode:
authorJulien Dessaux2011-08-08 20:56:20 +0200
committerJulien Dessaux2011-08-08 20:58:34 +0200
commit3b914c1b7729f52ba96e51ad43424909acae681c (patch)
treebc4f81ee8af1abea9cd2aef1471f288721b8f088 /Hsbot/Plugin
parentAdded Administrative plugin that will permit dynamic reloading (diff)
downloadhsbot-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 '')
-rw-r--r--Hsbot/Plugin/Admin.hs4
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 ()