{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent
import Control.Lens
import Network.IRC.Client
main :: IO ()
main = do
let conn = tlsConnection (WithDefaultConfig "irc.freenode.net" 6697)
& logfunc .~ stdoutLogger
let cfg = defaultInstanceConfig "nickname"
& channels .~ ["#channel"]
& handlers %~ (yourHandlers++)
ircstate <- newIRCState conn cfg initialState
forkIO (runClientWith ircstate)
-- you can now use runIRCAction with the ircstate value to interact with the client
-- eg:
runIRCAction disconnect ircstate
yourHandlers = []
initialState = ()