module Lambdabot.Config.Core
( commandPrefixes
, disabledCommands
, evalPrefixes
, onStartupCmds
, outputDir
, proxy
, trustedPackages
, uncaughtExceptionHandler
, replaceRootLogger
, lbRootLoggerPath
, consoleLogHandle
, consoleLogLevel
, consoleLogFormat
, aspellBinary
, bfBinary
, djinnBinary
, ghcBinary
, ghciBinary
, hoogleBinary
, muevalBinary
, unlambdaBinary
) where
import Lambdabot.Config
import Lambdabot.Logging
import Control.Exception
import Network.HTTP.Proxy
import System.IO
config "commandPrefixes" [t| [String] |] [| ["@", "?"] |]
config "disabledCommands" [t| [String] |] [| [] |]
config "evalPrefixes" [t| [String] |] [| [">"] |]
configWithMerge [| (++) |] "onStartupCmds" [t| [String] |] [| ["offline"] |]
config "outputDir" [t| FilePath |] [| "State/" |]
config "proxy" [t| Proxy |] [| NoProxy |]
config "replaceRootLogger" [t| Bool |] [| True |]
config "lbRootLoggerPath" [t| [String] |] [| [] |]
config "consoleLogHandle" [t| Handle |] [| stderr |]
config "consoleLogLevel" [t| Priority |] [| NOTICE |]
config "consoleLogFormat" [t| String |] [| "[$prio] $loggername: $msg" |]
config "aspellBinary" [t| String |] [| "aspell" |]
config "bfBinary" [t| String |] [| "bf" |]
config "djinnBinary" [t| String |] [| "djinn" |]
config "ghcBinary" [t| String |] [| "ghc" |]
config "ghciBinary" [t| String |] [| "ghci" |]
config "hoogleBinary" [t| String |] [| "hoogle" |]
config "muevalBinary" [t| String |] [| "mueval" |]
config "unlambdaBinary" [t| String |] [| "unlambda" |]
trustedPkgs :: [String]
trustedPkgs =
[ "array"
, "base"
, "bytestring"
, "containers"
, "lambdabot"
, "random"
]
configWithMerge [| (++) |] "trustedPackages" [t| [String] |] [| trustedPkgs |]
defaultIrcHandler :: SomeException -> IO ()
defaultIrcHandler = errorM . ("Main: caught (and ignoring) "++) . show
config "uncaughtExceptionHandler" [t| SomeException -> IO () |] [| defaultIrcHandler |]