import System.Environment (getArgs)
import System.IO (hFlush, hPutStrLn, stderr, stdout)
import TalkBot.IO (ltgt, maybePut, ircFilter)

main = do
  nicks <- getArgs
  hPutStrLn stderr $ "Responding to >> " ++ (show nicks)
  hFlush stderr
  step (fmap ltgt nicks)

step nicks = do
  i <- getLine
  maybePut . ircFilter nicks $ i
  step nicks
