guessBot :: IO Bot
guessBot = do
  secretVar <- newMVar 0
  nextGuess secretVar
  return $ \m -> case stripPrefix "/guess " m of
    Nothing ->
      return Nothing
    Just number -> do
      secret <- readMVar secretVar
      let guessResult = guess secret (read number)
      case guessResult of
        GuessCorrect ->
          -- Reset the guess when it's correct
          nextGuess secretVar
        _ ->
          return ()
      return (Just (guessRender guessResult))
guessBot :: IO Bot
guessBot = do
  secretVar <- newMVar 0
  nextGuess secretVar
  return $ \m -> case stripPrefix "/guess " m of
    Nothing ->
      return Nothing
    Just number -> do
      secret <- readMVar secretVar
      let guessResult = guess secret (read number)
      case guessResult of
        GuessCorrect ->
          -- Reset the guess when it's correct
          nextGuess secretVar
        _ ->
          return ()
      return (Just (guessRender guessResult))
guessBot = do
  secretVar <- newMVar 0
  nextGuess secretVar
  return $ \m -> case stripPrefix "/guess " m of
    Nothing ->
      return Nothing
    Just number -> do
      secret <- readMVar secretVar
      let guessResult = guess secret (read number)
      case guessResult of
        GuessCorrect ->
          -- Reset the guess when it's correct
          nextGuess secretVar
        _ ->
          return ()
      return (Just (guessRender guessResult))