summaryrefslogtreecommitdiff
path: root/Conf.hs
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 14:12:17 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-14 14:12:17 +0000
commita7865fd10582a9b710e96d2052a9ce90ced8020c (patch)
tree00f7ce23717a4aca2352adb6346f5daa18411ec8 /Conf.hs
parent3b090644f148acf856e925be59e6915ea524a3f8 (diff)
added environment
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@26 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'Conf.hs')
-rw-r--r--Conf.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Conf.hs b/Conf.hs
index 33be1dd..9db9c19 100644
--- a/Conf.hs
+++ b/Conf.hs
@@ -7,7 +7,7 @@ type Conf = M.Map String String
makeConf = M.fromList
[ ("name", "HsBot")
, ("version", "v0.0")
- , ("database", "hsbot.db")
+ , ("databaseFile", "hsbot.db")
, ("maxMessageSize", "400")
, ("admin", "rantanplan")
, ("ircServer", "irc.german-elite.net")
@@ -19,3 +19,10 @@ makeConf = M.fromList
get :: (Monad m) => String -> Conf -> m String
get = M.lookup
+
+getUnwrappedInt :: String -> Conf -> Int
+getUnwrappedInt key conf = read (getUnwrapped key conf) :: Int
+
+getUnwrapped :: String -> Conf -> String
+getUnwrapped key conf = do { val <- get key conf; val }
+