parseRequest :: P.Pipe B.ByteString Request Asked ()
parseRequest = forever $ do
    botnick <- RWS.ask
    req <- (JSON.decodeStrict >=> parse botnick) <$> P.await
    unless (isNothing req) $ P.yield (fromJust req)
  where
    parse botnick (BT.ServerPrivMsg _ _ msg)
        = Just
        . fromMaybe OtherMessage
        . hush
        . Parse.parse (request botnick) ""
        . BT.getMessage
        $ msg
    parse _ _ = Nothing
parseRequest :: P.Pipe B.ByteString Request Asked ()
parseRequest = forever $ do
    botnick <- RWS.ask
    req <- (JSON.decodeStrict >=> parse botnick) <$> P.await
    unless (isNothing req) $ P.yield (fromJust req)
  where
    parse botnick (BT.ServerPrivMsg _ _ msg)
        = Just
        . fromMaybe OtherMessage
        . hush
        . Parse.parse (request botnick) ""
        . BT.getMessage
        $ msg
    parse _ _ = Nothing
parseRequest = forever $ do
    botnick <- RWS.ask
    req <- (JSON.decodeStrict >=> parse botnick) <$> P.await
    unless (isNothing req) $ P.yield (fromJust req)
  where
    parse botnick (BT.ServerPrivMsg _ _ msg)
        = Just
        . fromMaybe OtherMessage
        . hush
        . Parse.parse (request botnick) ""
        . BT.getMessage
        $ msg
    parse _ _ = Nothing