Archived
1
0
Fork 0

Got rid of the pseudo dynamic starting stuff, wrote a decent CLI parameters handling.

This commit is contained in:
Julien Dessaux 2010-07-16 00:55:50 +02:00
parent 116c655fdc
commit 5cb9f9ccfc
4 changed files with 68 additions and 56 deletions

View file

@ -24,13 +24,13 @@ hsbot config txtResumeData= do
Just txtData -> read txtData :: BotResumeData -- TODO : catch exception
Nothing -> M.empty :: BotResumeData
startTime <- case M.lookup "HSBOT" resumeData of
Just hsbotData -> do
case M.lookup "STARTTIME" hsbotData of
Just txtStartTime -> do
let gotStartTime = read txtStartTime :: UTCTime
return gotStartTime
Nothing -> getCurrentTime
Nothing -> getCurrentTime
Just hsbotData -> do
case M.lookup "STARTTIME" hsbotData of
Just txtStartTime -> do
let gotStartTime = read txtStartTime :: UTCTime
return gotStartTime
Nothing -> getCurrentTime
Nothing -> getCurrentTime
let resumeData' = M.insert "HSBOT" (M.singleton "STARTTIME" $ show startTime) resumeData
putStrLn "[Hsbot] Opening communication channel... "
chan <- newChan :: IO (Chan BotMsg)