packages feed

irc-client-1.0.0.0: Main.hs

{-# 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 = ()