code: @Override
    public HttpAction getNextMessage() {
  
      Userinfo userinfo = bot.getUserinfo();
      Set<String> rights = userinfo.getRights();
      boolean canWrite =
          rights.contains(Userinfo.RIGHT_EDIT)
              && //
              rights.contains(Userinfo.RIGHT_WRITEAPI);
  
      if (!canWrite) {
        throw new VersionException("editing is not allowed");
      }
      if (first) {
        first = false;
        editTokeAction = newTokenRequest();
        apiGet = editTokeAction.popAction();
        return apiGet;
      } else if (second) {
  
        RequestBuilder builder =
            new ApiRequestBuilder() //
                .action("edit") //
                .formatXml() //
                .param("title", MediaWiki.urlEncode(a.getTitle())) //
                .postParam("summary", a.getEditSummary()) //
                .postParam("text", a.getText()) //
            ;
        Set<String> groups = userinfo.getGroups();
        if (!isIntersectionEmpty(groups, MediaWiki.BOT_GROUPS)) {
          builder.postParam(PARAM_BOTEDIT, "");
        }
  
        // postModify.addParam("watch", "unknown")
        if (a.isMinorEdit()) {
          builder.postParam(PARAM_MINOR, "");
        } else {
          builder.postParam(PARAM_MINOR_NOT, "");
        }
        builder.postParam(editTokeAction.get().token());
        second = false;
  
        editRequest = builder.buildPost();
        return editRequest;
      } else {
        throw new IllegalStateException("this action has only two messages");
      }
    }
docs: {@inheritDoc}