From 68cda72ece0ee8117e1e106bca2bbf47e0865516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Petersen?= Date: Mon, 20 Jun 2016 20:50:03 +0200 Subject: [PATCH] Fix replay/reply typo and deprecate old methods. Fixes #97 --- .../api/methods/send/SendAudio.java | 56 ++++++++--- .../api/methods/send/SendContact.java | 72 ++++++++++---- .../api/methods/send/SendDocument.java | 56 ++++++++--- .../api/methods/send/SendLocation.java | 72 ++++++++++---- .../api/methods/send/SendMessage.java | 72 ++++++++++---- .../api/methods/send/SendPhoto.java | 56 ++++++++--- .../api/methods/send/SendSticker.java | 56 ++++++++--- .../api/methods/send/SendVenue.java | 72 ++++++++++---- .../api/methods/send/SendVideo.java | 56 ++++++++--- .../api/methods/send/SendVoice.java | 56 ++++++++--- .../telegram/telegrambots/bots/AbsSender.java | 98 +++++++++---------- 11 files changed, 521 insertions(+), 201 deletions(-) diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java index 141fdf02..a450b5d0 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java @@ -30,13 +30,13 @@ public class SendAudio { private Integer duration; ///< Integer Duration of the audio in seconds as defined by sender private String chatId; ///< Unique identifier for the chat to send the message to (or Username fro channels) private String audio; ///< Audio file to send. file_id as String to resend an audio that is already on the Telegram servers - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message /** * Optional. Sends the message silently. iOS users will not receive a notification, Android * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private String performer; ///< Optional. Performer of sent audio private String title; ///< Optional. Title of sent audio @@ -117,22 +117,54 @@ public class SendAudio { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendAudio setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendAudio setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendAudio setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendAudio setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendAudio setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendAudio setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public String getPerformer() { @@ -188,8 +220,8 @@ public class SendAudio { return "SendAudio{" + "chatId='" + chatId + '\'' + ", audio='" + audio + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", performer='" + performer + '\'' + ", title='" + title + '\'' + ", isNewAudio=" + isNewAudio + diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java index 3fd86098..a8c94889 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendContact.java @@ -38,8 +38,8 @@ public class SendContact extends BotApiMethod { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard public String getChatId() { return chatId; @@ -50,22 +50,54 @@ public class SendContact extends BotApiMethod { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendContact setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendContact setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendContact setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendContact setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendContact setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendContact setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public Boolean getDisableNotification() { @@ -134,11 +166,11 @@ public class SendContact extends BotApiMethod { if (disableNotification != null) { jsonObject.put(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - jsonObject.put(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + jsonObject.put(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - jsonObject.put(REPLYMARKUP_FIELD, replayMarkup.toJson()); + if (replyMarkup != null) { + jsonObject.put(REPLYMARKUP_FIELD, replyMarkup.toJson()); } return jsonObject; @@ -157,11 +189,11 @@ public class SendContact extends BotApiMethod { if (disableNotification != null) { gen.writeBooleanField(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - gen.writeObjectField(REPLYMARKUP_FIELD, replayMarkup); + if (replyMarkup != null) { + gen.writeObjectField(REPLYMARKUP_FIELD, replyMarkup); } gen.writeEndObject(); @@ -180,8 +212,8 @@ public class SendContact extends BotApiMethod { ", phoneNumber=" + phoneNumber + ", firstName=" + firstName + ", lastName=" + lastName + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + '}'; } } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java index 3a2da623..9ab38fee 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java @@ -28,8 +28,8 @@ public class SendDocument { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private boolean isNewDocument; ///< True to upload a new document, false to use a fileId private String documentName; @@ -120,15 +120,31 @@ public class SendDocument { return newDocumentStream; } - public Integer getReplayToMessageId() { - return replayToMessageId; + public Integer getReplyToMessageId() { + return replyToMessageId; } - public SendDocument setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; + public SendDocument setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; return this; } + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated + public Integer getReplayToMessageId() { + return getReplyToMessageId(); + } + + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendDocument setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); + } + public Boolean getDisableNotification() { return disableNotification; } @@ -152,22 +168,38 @@ public class SendDocument { return this; } - public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; } - public SendDocument setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; + public SendDocument setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; return this; } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated + public ReplyKeyboard getReplayMarkup() { + return getReplyMarkup(); + } + + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendDocument setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); + } + @Override public String toString() { return "SendDocument{" + "chatId='" + chatId + '\'' + ", document='" + document + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", isNewDocument=" + isNewDocument + '}'; } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java index a9d2ee45..31f2701b 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendLocation.java @@ -35,8 +35,8 @@ public class SendLocation extends BotApiMethod { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard public String getChatId() { return chatId; @@ -65,22 +65,54 @@ public class SendLocation extends BotApiMethod { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendLocation setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendLocation setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendLocation setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendLocation setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendLocation setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendLocation setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public Boolean getDisableNotification() { @@ -119,11 +151,11 @@ public class SendLocation extends BotApiMethod { if (disableNotification != null) { jsonObject.put(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - jsonObject.put(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + jsonObject.put(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - jsonObject.put(REPLYMARKUP_FIELD, replayMarkup.toJson()); + if (replyMarkup != null) { + jsonObject.put(REPLYMARKUP_FIELD, replyMarkup.toJson()); } return jsonObject; @@ -139,11 +171,11 @@ public class SendLocation extends BotApiMethod { if (disableNotification != null) { gen.writeBooleanField(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - gen.writeObjectField(REPLYMARKUP_FIELD, replayMarkup); + if (replyMarkup != null) { + gen.writeObjectField(REPLYMARKUP_FIELD, replyMarkup); } gen.writeEndObject(); @@ -161,8 +193,8 @@ public class SendLocation extends BotApiMethod { "chatId='" + chatId + '\'' + ", latitude=" + latitude + ", longitude=" + longitude + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + '}'; } } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java index 722b8f2a..b0f885bd 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendMessage.java @@ -38,8 +38,8 @@ public class SendMessage extends BotApiMethod { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard public SendMessage() { super(); @@ -63,22 +63,54 @@ public class SendMessage extends BotApiMethod { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendMessage setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendMessage setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendMessage setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendMessage setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendMessage setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendMessage setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public Boolean getDisableWebPagePreview() { @@ -141,11 +173,11 @@ public class SendMessage extends BotApiMethod { if (disableNotification != null) { jsonObject.put(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - jsonObject.put(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + jsonObject.put(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - jsonObject.put(REPLYMARKUP_FIELD, replayMarkup.toJson()); + if (replyMarkup != null) { + jsonObject.put(REPLYMARKUP_FIELD, replyMarkup.toJson()); } return jsonObject; @@ -180,11 +212,11 @@ public class SendMessage extends BotApiMethod { if (disableNotification != null) { gen.writeBooleanField(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - gen.writeObjectField(REPLYMARKUP_FIELD, replayMarkup); + if (replyMarkup != null) { + gen.writeObjectField(REPLYMARKUP_FIELD, replyMarkup); } gen.writeEndObject(); @@ -203,8 +235,8 @@ public class SendMessage extends BotApiMethod { ", text='" + text + '\'' + ", parseMode='" + parseMode + '\'' + ", disableWebPagePreview=" + disableWebPagePreview + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + '}'; } } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java index 5ed0d039..ecb89cf7 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java @@ -28,8 +28,8 @@ public class SendPhoto { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private boolean isNewPhoto; ///< True if the photo must be uploaded from a file, file if it is a fileId private String photoName; ///< Name of the photo @@ -68,22 +68,54 @@ public class SendPhoto { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendPhoto setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendPhoto setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendPhoto setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendPhoto setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendPhoto setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendPhoto setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public boolean isNewPhoto() { @@ -151,8 +183,8 @@ public class SendPhoto { "chatId='" + chatId + '\'' + ", photo='" + photo + '\'' + ", caption='" + caption + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", isNewPhoto=" + isNewPhoto + '}'; } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java index 0999ad76..8a091729 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendSticker.java @@ -26,8 +26,8 @@ public class SendSticker { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private boolean isNewSticker; ///< True to upload a new sticker, false to use a fileId private String stickerName; @@ -57,22 +57,54 @@ public class SendSticker { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendSticker setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendSticker setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendSticker setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendSticker setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendSticker setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendSticker setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } /** @@ -139,8 +171,8 @@ public class SendSticker { return "SendSticker{" + "chatId='" + chatId + '\'' + ", sticker='" + sticker + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", isNewSticker=" + isNewSticker + '}'; } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java index a2512132..46ead134 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVenue.java @@ -42,8 +42,8 @@ public class SendVenue extends BotApiMethod { private Boolean disableNotification; private String address; ///< Address of the venue private String foursquareId; ///< Optional. Foursquare identifier of the venue - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard public String getChatId() { return chatId; @@ -72,22 +72,54 @@ public class SendVenue extends BotApiMethod { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendVenue setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendVenue setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendVenue setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendVenue setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendVenue setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendVenue setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public Boolean getDisableNotification() { @@ -158,11 +190,11 @@ public class SendVenue extends BotApiMethod { if (disableNotification != null) { jsonObject.put(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - jsonObject.put(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + jsonObject.put(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - jsonObject.put(REPLYMARKUP_FIELD, replayMarkup.toJson()); + if (replyMarkup != null) { + jsonObject.put(REPLYMARKUP_FIELD, replyMarkup.toJson()); } return jsonObject; @@ -183,11 +215,11 @@ public class SendVenue extends BotApiMethod { if (disableNotification != null) { gen.writeBooleanField(DISABLENOTIFICATION_FIELD, disableNotification); } - if (replayToMessageId != null) { - gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replayToMessageId); + if (replyToMessageId != null) { + gen.writeNumberField(REPLYTOMESSAGEID_FIELD, replyToMessageId); } - if (replayMarkup != null) { - gen.writeObjectField(REPLYMARKUP_FIELD, replayMarkup); + if (replyMarkup != null) { + gen.writeObjectField(REPLYMARKUP_FIELD, replyMarkup); } gen.writeEndObject(); @@ -208,8 +240,8 @@ public class SendVenue extends BotApiMethod { ", title=" + title + ", address=" + address + ", foursquareId=" + foursquareId + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + '}'; } } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java index d4338594..393edf38 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java @@ -35,8 +35,8 @@ public class SendVideo { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private boolean isNewVideo; ///< True to upload a new video, false to use a fileId private String videoName; ///< Name of the video @@ -84,22 +84,54 @@ public class SendVideo { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendVideo setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendVideo setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendVideo setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendVideo setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendVideo setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendVideo setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public boolean isNewVideo() { @@ -186,8 +218,8 @@ public class SendVideo { ", video='" + video + '\'' + ", duration=" + duration + ", caption='" + caption + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", isNewVideo=" + isNewVideo + '}'; } diff --git a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java index 3ceeb59a..0c7fce91 100644 --- a/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java +++ b/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java @@ -30,8 +30,8 @@ public class SendVoice { * users will receive a notification with no sound. Other apps coming soon */ private Boolean disableNotification; - private Integer replayToMessageId; ///< Optional. If the message is a reply, ID of the original message - private ReplyKeyboard replayMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard + private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard private Integer duration; ///< Optional. Duration of sent audio in seconds private boolean isNewVoice; ///< True to upload a new voice note, false to use a fileId @@ -48,8 +48,8 @@ public class SendVoice { return "SendVoice{" + "chatId='" + chatId + '\'' + ", voice='" + voice + '\'' + - ", replayToMessageId=" + replayToMessageId + - ", replayMarkup=" + replayMarkup + + ", replyToMessageId=" + replyToMessageId + + ", replyMarkup=" + replyMarkup + ", duration=" + duration + '}'; } @@ -150,22 +150,54 @@ public class SendVoice { return this; } + public Integer getReplyToMessageId() { + return replyToMessageId; + } + + public SendVoice setReplyToMessageId(Integer replyToMessageId) { + this.replyToMessageId = replyToMessageId; + return this; + } + + public ReplyKeyboard getReplyMarkup() { + return replyMarkup; + } + + public SendVoice setReplyMarkup(ReplyKeyboard replyMarkup) { + this.replyMarkup = replyMarkup; + return this; + } + + /** + * @deprecated Use {@link #getReplyToMessageId()} instead. + */ + @Deprecated public Integer getReplayToMessageId() { - return replayToMessageId; + return getReplyToMessageId(); } - public SendVoice setReplayToMessageId(Integer replayToMessageId) { - this.replayToMessageId = replayToMessageId; - return this; + /** + * @deprecated Use {@link #setReplyToMessageId(Integer)} instead. + */ + @Deprecated + public SendVoice setReplayToMessageId(Integer replyToMessageId) { + return setReplyToMessageId(replyToMessageId); } + /** + * @deprecated Use {@link #getReplyMarkup()} instead. + */ + @Deprecated public ReplyKeyboard getReplayMarkup() { - return replayMarkup; + return getReplyMarkup(); } - public SendVoice setReplayMarkup(ReplyKeyboard replayMarkup) { - this.replayMarkup = replayMarkup; - return this; + /** + * @deprecated Use {@link #setReplyMarkup(ReplyKeyboard)} instead. + */ + @Deprecated + public SendVoice setReplayMarkup(ReplyKeyboard replyMarkup) { + return setReplyMarkup(replyMarkup); } public Integer getDuration() { diff --git a/src/main/java/org/telegram/telegrambots/bots/AbsSender.java b/src/main/java/org/telegram/telegrambots/bots/AbsSender.java index 4196fa9d..035ef98c 100644 --- a/src/main/java/org/telegram/telegrambots/bots/AbsSender.java +++ b/src/main/java/org/telegram/telegrambots/bots/AbsSender.java @@ -511,11 +511,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendDocument.DOCUMENT_FIELD, new java.io.File(sendDocument.getDocument()), ContentType.APPLICATION_OCTET_STREAM, sendDocument.getDocumentName()); } - if (sendDocument.getReplayMarkup() != null) { - builder.addTextBody(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendDocument.getReplyMarkup() != null) { + builder.addTextBody(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendDocument.getReplayToMessageId() != null) { - builder.addTextBody(SendDocument.REPLYTOMESSAGEID_FIELD, sendDocument.getReplayToMessageId().toString()); + if (sendDocument.getReplyToMessageId() != null) { + builder.addTextBody(SendDocument.REPLYTOMESSAGEID_FIELD, sendDocument.getReplyToMessageId().toString()); } if (sendDocument.getCaption() != null) { builder.addTextBody(SendDocument.CAPTION_FIELD, sendDocument.getCaption(), TEXT_PLAIN_CONTENT_TYPE); @@ -529,16 +529,16 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendDocument.CHATID_FIELD, sendDocument.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendDocument.DOCUMENT_FIELD, sendDocument.getDocument())); - if (sendDocument.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toJson().toString())); + if (sendDocument.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplyMarkup().toJson().toString())); } - if (sendDocument.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYTOMESSAGEID_FIELD, sendDocument.getReplayToMessageId().toString())); + if (sendDocument.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYTOMESSAGEID_FIELD, sendDocument.getReplyToMessageId().toString())); } if (sendDocument.getCaption() != null) { nameValuePairs.add(new BasicNameValuePair(SendDocument.CAPTION_FIELD, sendDocument.getCaption())); } - if (sendDocument.getReplayToMessageId() != null) { + if (sendDocument.getReplyToMessageId() != null) { nameValuePairs.add(new BasicNameValuePair(SendDocument.DISABLENOTIFICATION_FIELD, sendDocument.getDisableNotification().toString())); } httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, StandardCharsets.UTF_8)); @@ -577,11 +577,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendPhoto.PHOTO_FIELD, new java.io.File(sendPhoto.getPhoto()), ContentType.APPLICATION_OCTET_STREAM, sendPhoto.getPhotoName()); } - if (sendPhoto.getReplayMarkup() != null) { - builder.addTextBody(SendPhoto.REPLYMARKUP_FIELD, sendPhoto.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendPhoto.getReplyMarkup() != null) { + builder.addTextBody(SendPhoto.REPLYMARKUP_FIELD, sendPhoto.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendPhoto.getReplayToMessageId() != null) { - builder.addTextBody(SendPhoto.REPLYTOMESSAGEID_FIELD, sendPhoto.getReplayToMessageId().toString()); + if (sendPhoto.getReplyToMessageId() != null) { + builder.addTextBody(SendPhoto.REPLYTOMESSAGEID_FIELD, sendPhoto.getReplyToMessageId().toString()); } if (sendPhoto.getCaption() != null) { builder.addTextBody(SendPhoto.CAPTION_FIELD, sendPhoto.getCaption(), TEXT_PLAIN_CONTENT_TYPE); @@ -595,11 +595,11 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendPhoto.CHATID_FIELD, sendPhoto.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendPhoto.PHOTO_FIELD, sendPhoto.getPhoto())); - if (sendPhoto.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendPhoto.REPLYMARKUP_FIELD, sendPhoto.getReplayMarkup().toJson().toString())); + if (sendPhoto.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendPhoto.REPLYMARKUP_FIELD, sendPhoto.getReplyMarkup().toJson().toString())); } - if (sendPhoto.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendPhoto.REPLYTOMESSAGEID_FIELD, sendPhoto.getReplayToMessageId().toString())); + if (sendPhoto.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendPhoto.REPLYTOMESSAGEID_FIELD, sendPhoto.getReplyToMessageId().toString())); } if (sendPhoto.getCaption() != null) { nameValuePairs.add(new BasicNameValuePair(SendPhoto.CAPTION_FIELD, sendPhoto.getCaption())); @@ -643,11 +643,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendVideo.VIDEO_FIELD, new java.io.File(sendVideo.getVideo()), ContentType.APPLICATION_OCTET_STREAM, sendVideo.getVideoName()); } - if (sendVideo.getReplayMarkup() != null) { - builder.addTextBody(SendVideo.REPLYMARKUP_FIELD, sendVideo.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendVideo.getReplyMarkup() != null) { + builder.addTextBody(SendVideo.REPLYMARKUP_FIELD, sendVideo.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendVideo.getReplayToMessageId() != null) { - builder.addTextBody(SendVideo.REPLYTOMESSAGEID_FIELD, sendVideo.getReplayToMessageId().toString()); + if (sendVideo.getReplyToMessageId() != null) { + builder.addTextBody(SendVideo.REPLYTOMESSAGEID_FIELD, sendVideo.getReplyToMessageId().toString()); } if (sendVideo.getCaption() != null) { builder.addTextBody(SendVideo.CAPTION_FIELD, sendVideo.getCaption(), TEXT_PLAIN_CONTENT_TYPE); @@ -670,11 +670,11 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendVideo.CHATID_FIELD, sendVideo.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendVideo.VIDEO_FIELD, sendVideo.getVideo())); - if (sendVideo.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendVideo.REPLYMARKUP_FIELD, sendVideo.getReplayMarkup().toJson().toString())); + if (sendVideo.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendVideo.REPLYMARKUP_FIELD, sendVideo.getReplyMarkup().toJson().toString())); } - if (sendVideo.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendVideo.REPLYTOMESSAGEID_FIELD, sendVideo.getReplayToMessageId().toString())); + if (sendVideo.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendVideo.REPLYTOMESSAGEID_FIELD, sendVideo.getReplyToMessageId().toString())); } if (sendVideo.getCaption() != null) { nameValuePairs.add(new BasicNameValuePair(SendVideo.CAPTION_FIELD, sendVideo.getCaption())); @@ -728,11 +728,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendSticker.STICKER_FIELD, new java.io.File(sendSticker.getSticker()), ContentType.APPLICATION_OCTET_STREAM, sendSticker.getStickerName()); } - if (sendSticker.getReplayMarkup() != null) { - builder.addTextBody(SendSticker.REPLYMARKUP_FIELD, sendSticker.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendSticker.getReplyMarkup() != null) { + builder.addTextBody(SendSticker.REPLYMARKUP_FIELD, sendSticker.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendSticker.getReplayToMessageId() != null) { - builder.addTextBody(SendSticker.REPLYTOMESSAGEID_FIELD, sendSticker.getReplayToMessageId().toString()); + if (sendSticker.getReplyToMessageId() != null) { + builder.addTextBody(SendSticker.REPLYTOMESSAGEID_FIELD, sendSticker.getReplyToMessageId().toString()); } if (sendSticker.getDisableNotification() != null) { builder.addTextBody(SendSticker.DISABLENOTIFICATION_FIELD, sendSticker.getDisableNotification().toString()); @@ -743,11 +743,11 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendSticker.CHATID_FIELD, sendSticker.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendSticker.STICKER_FIELD, sendSticker.getSticker())); - if (sendSticker.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendSticker.REPLYMARKUP_FIELD, sendSticker.getReplayMarkup().toJson().toString())); + if (sendSticker.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendSticker.REPLYMARKUP_FIELD, sendSticker.getReplyMarkup().toJson().toString())); } - if (sendSticker.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendSticker.REPLYTOMESSAGEID_FIELD, sendSticker.getReplayToMessageId().toString())); + if (sendSticker.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendSticker.REPLYTOMESSAGEID_FIELD, sendSticker.getReplyToMessageId().toString())); } if (sendSticker.getDisableNotification() != null) { nameValuePairs.add(new BasicNameValuePair(SendSticker.DISABLENOTIFICATION_FIELD, sendSticker.getDisableNotification().toString())); @@ -796,11 +796,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendAudio.AUDIO_FIELD, new java.io.File(sendAudio.getAudio()), ContentType.create("audio/mpeg"), sendAudio.getAudioName()); } - if (sendAudio.getReplayMarkup() != null) { - builder.addTextBody(SendAudio.REPLYMARKUP_FIELD, sendAudio.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendAudio.getReplyMarkup() != null) { + builder.addTextBody(SendAudio.REPLYMARKUP_FIELD, sendAudio.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendAudio.getReplayToMessageId() != null) { - builder.addTextBody(SendAudio.REPLYTOMESSAGEID_FIELD, sendAudio.getReplayToMessageId().toString()); + if (sendAudio.getReplyToMessageId() != null) { + builder.addTextBody(SendAudio.REPLYTOMESSAGEID_FIELD, sendAudio.getReplyToMessageId().toString()); } if (sendAudio.getPerformer() != null) { builder.addTextBody(SendAudio.PERFOMER_FIELD, sendAudio.getPerformer()); @@ -820,11 +820,11 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendAudio.CHATID_FIELD, sendAudio.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendAudio.AUDIO_FIELD, sendAudio.getAudio())); - if (sendAudio.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendAudio.REPLYMARKUP_FIELD, sendAudio.getReplayMarkup().toJson().toString())); + if (sendAudio.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendAudio.REPLYMARKUP_FIELD, sendAudio.getReplyMarkup().toJson().toString())); } - if (sendAudio.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendAudio.REPLYTOMESSAGEID_FIELD, sendAudio.getReplayToMessageId().toString())); + if (sendAudio.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendAudio.REPLYTOMESSAGEID_FIELD, sendAudio.getReplyToMessageId().toString())); } if (sendAudio.getPerformer() != null) { nameValuePairs.add(new BasicNameValuePair(SendAudio.PERFOMER_FIELD, sendAudio.getPerformer())); @@ -885,11 +885,11 @@ public abstract class AbsSender { } else { builder.addBinaryBody(SendVoice.VOICE_FIELD, new java.io.File(sendVoice.getVoice()), ContentType.create("audio/ogg"), sendVoice.getVoiceName()); } - if (sendVoice.getReplayMarkup() != null) { - builder.addTextBody(SendVoice.REPLYMARKUP_FIELD, sendVoice.getReplayMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); + if (sendVoice.getReplyMarkup() != null) { + builder.addTextBody(SendVoice.REPLYMARKUP_FIELD, sendVoice.getReplyMarkup().toJson().toString(), TEXT_PLAIN_CONTENT_TYPE); } - if (sendVoice.getReplayToMessageId() != null) { - builder.addTextBody(SendVoice.REPLYTOMESSAGEID_FIELD, sendVoice.getReplayToMessageId().toString()); + if (sendVoice.getReplyToMessageId() != null) { + builder.addTextBody(SendVoice.REPLYTOMESSAGEID_FIELD, sendVoice.getReplyToMessageId().toString()); } if (sendVoice.getDisableNotification() != null) { builder.addTextBody(SendVoice.DISABLENOTIFICATION_FIELD, sendVoice.getDisableNotification().toString()); @@ -903,11 +903,11 @@ public abstract class AbsSender { List nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendVoice.CHATID_FIELD, sendVoice.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendVoice.VOICE_FIELD, sendVoice.getVoice())); - if (sendVoice.getReplayMarkup() != null) { - nameValuePairs.add(new BasicNameValuePair(SendVoice.REPLYMARKUP_FIELD, sendVoice.getReplayMarkup().toJson().toString())); + if (sendVoice.getReplyMarkup() != null) { + nameValuePairs.add(new BasicNameValuePair(SendVoice.REPLYMARKUP_FIELD, sendVoice.getReplyMarkup().toJson().toString())); } - if (sendVoice.getReplayToMessageId() != null) { - nameValuePairs.add(new BasicNameValuePair(SendVoice.REPLYTOMESSAGEID_FIELD, sendVoice.getReplayToMessageId().toString())); + if (sendVoice.getReplyToMessageId() != null) { + nameValuePairs.add(new BasicNameValuePair(SendVoice.REPLYTOMESSAGEID_FIELD, sendVoice.getReplyToMessageId().toString())); } if (sendVoice.getDisableNotification() != null) { nameValuePairs.add(new BasicNameValuePair(SendVoice.DISABLENOTIFICATION_FIELD, sendVoice.getDisableNotification().toString()));