socketWriter :: Handle -> Bot s a
socketWriter sock = do
  outQ <- use outQueue
  debugMsg "starting socketWriter"
  forever $ do
    debugMsg "waiting for output"
    line <- readChan outQ
    let msgStr = fromIRCMsg line
    debugMsgByteString msgStr
    liftIO (BS.hPutStr sock msgStr)
    debugMsg "output sent"

-- |Listens for PING messages and replies with a suitable PONG
socketWriter :: Handle -> Bot s a
socketWriter sock = do
  outQ <- use outQueue
  debugMsg "starting socketWriter"
  forever $ do
    debugMsg "waiting for output"
    line <- readChan outQ
    let msgStr = fromIRCMsg line
    debugMsgByteString msgStr
    liftIO (BS.hPutStr sock msgStr)
    debugMsg "output sent"

-- |Listens for PING messages and replies with a suitable PONG
socketWriter sock = do
  outQ <- use outQueue
  debugMsg "starting socketWriter"
  forever $ do
    debugMsg "waiting for output"
    line <- readChan outQ
    let msgStr = fromIRCMsg line
    debugMsgByteString msgStr
    liftIO (BS.hPutStr sock msgStr)
    debugMsg "output sent"

-- |Listens for PING messages and replies with a suitable PONG