{-# LANGUAGE OverloadedStrings #-}

module MuevalSlack.Configuration (
  getConfiguration
) where

import Data.Configurator (Worth(Required), load, require)
import Data.Configurator.Types (Config)

parseConfiguration :: Config -> IO String
parseConfiguration = flip require "access_token"

getConfiguration :: FilePath -> IO String
getConfiguration path = load [Required path] >>= parseConfiguration
