hask-irc/hask-irc-runner/Main.hs

23 lines
506 B
Haskell
Raw Normal View History

2014-05-25 15:52:15 +05:30
module Main where
2014-06-01 23:14:19 +05:30
import ClassyPrelude hiding (getArgs)
import System.Environment (getArgs, getProgName)
import System.Exit (exitFailure)
2014-05-25 15:52:15 +05:30
2014-06-01 23:14:19 +05:30
import Network.IRC.Client
import Network.IRC.Config
2014-05-25 15:52:15 +05:30
main :: IO ()
2014-06-01 23:14:19 +05:30
main = do
-- get args
args <- getArgs
prog <- getProgName
when (length args < 1) $ do
putStrLn $ "Usage: " ++ pack prog ++ " <config file path>"
exitFailure
-- load config and start the bot
let configFile = headEx args
loadBotConfig configFile >>= runBot