getSlackWebsocket :: T.Text -> IO (S.HostName, String)
getSlackWebsocket token = do
  r <- get $ "https://slack.com/api/rtm.start?token=" ++ (T.unpack token)
  let Just (BoolPrim ok) = r ^? responseBody . key "ok"  . _Primitive
  unless ok $ do
    putStrLn "Unable to connect"
    ioError . userError . T.unpack $ r ^. responseBody . key "error" . _String
  let Just url = r ^? responseBody . key "url" . _String
  return $ parseWebsocket url
getSlackWebsocket :: T.Text -> IO (S.HostName, String)
getSlackWebsocket token = do
  r <- get $ "https://slack.com/api/rtm.start?token=" ++ (T.unpack token)
  let Just (BoolPrim ok) = r ^? responseBody . key "ok"  . _Primitive
  unless ok $ do
    putStrLn "Unable to connect"
    ioError . userError . T.unpack $ r ^. responseBody . key "error" . _String
  let Just url = r ^? responseBody . key "url" . _String
  return $ parseWebsocket url
getSlackWebsocket token = do
  r <- get $ "https://slack.com/api/rtm.start?token=" ++ (T.unpack token)
  let Just (BoolPrim ok) = r ^? responseBody . key "ok"  . _Primitive
  unless ok $ do
    putStrLn "Unable to connect"
    ioError . userError . T.unpack $ r ^. responseBody . key "error" . _String
  let Just url = r ^? responseBody . key "url" . _String
  return $ parseWebsocket url