Archived
1
0
Fork 0

Added exception handling, an autorestart when that happens and output in case of restart/reload

This commit is contained in:
Julien Dessaux 2011-08-08 20:56:20 +02:00
parent fe1acc3db5
commit 3b914c1b77
6 changed files with 61 additions and 36 deletions

View file

@ -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 ()