try {
CloseableHttpClient httpClient = HttpClients.createDefault();
String url = Constants.BASEURL + botToken + "/" + SendDocument.PATH;
HttpPost httppost = new HttpPost(url);
if (sendDocument.isNewDocument()) {
<BUG>MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addTextBody(SendDocument.CHATID_FIELD, sendDocument.getChatId().toString());
builder.addBinaryBody(SendDocument.DOCUMENT_FIELD, new File(sendDocument.getDocument()), ContentType.APPLICATION_OCTET_STREAM, sendDocument.getDocumentName());</BUG>
if (sendDocument.getReplayMarkup() != null) {
builder.addTextBody(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toJson().toString());

try {
CloseableHttpClient httpClient = HttpClients.createDefault();
String url = Constants.BASEURL + botToken + "/" + SendDocument.PATH;
HttpPost httppost = new HttpPost(url);
if (sendDocument.isNewDocument()) {
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
if (sendDocument.getChatId() == null) {
builder.addTextBody(SendDocument.CHATID_FIELD, sendDocument.getChannelId());
} else {
builder.addTextBody(SendDocument.CHATID_FIELD, sendDocument.getChatId().toString());
}
builder.addBinaryBody(SendDocument.DOCUMENT_FIELD, new File(sendDocument.getDocument()), ContentType.APPLICATION_OCTET_STREAM, sendDocument.getDocumentName());
if (sendDocument.getReplayMarkup() != null) {
builder.addTextBody(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toJson().toString());
