@@ -960,6 +1472,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index f2180275..0e7e1639 100644
--- a/README.md
+++ b/README.md
@@ -27,16 +27,16 @@ Just import add the library to your project with one of these options:
org.telegramtelegrambots
- 3.5
+ 3.6
```
```gradle
- compile "org.telegram:telegrambots:3.5"
+ compile "org.telegram:telegrambots:3.6"
```
- 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.5)
- 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.5)
+ 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.6)
+ 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.6)
In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.
diff --git a/TelegramBots.wiki/Changelog.md b/TelegramBots.wiki/Changelog.md
index bbe00b59..1509ad43 100644
--- a/TelegramBots.wiki/Changelog.md
+++ b/TelegramBots.wiki/Changelog.md
@@ -1,3 +1,7 @@
+### 3.6 ###
+1. Support for Api Version [3.6](https://core.telegram.org/bots/api-changelog#february-13-2018)
+2. Bug fixing and other improvements
+
### 3.5 ###
1. Support for Api Version [3.5](https://core.telegram.org/bots/api-changelog#november-17-2017)
2. Bug fixing: #168, #329 and #335
diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md
index e39f0eea..da550b3f 100644
--- a/TelegramBots.wiki/Getting-Started.md
+++ b/TelegramBots.wiki/Getting-Started.md
@@ -11,7 +11,7 @@ First you need ot get the library and add it to your project. There are few poss
org.telegramtelegrambots
- 3.5
+ 3.6
```
* With **Gradle**:
diff --git a/TelegramBots.wiki/abilities/Simple-Example.md b/TelegramBots.wiki/abilities/Simple-Example.md
index 8b718183..a64fb9d0 100644
--- a/TelegramBots.wiki/abilities/Simple-Example.md
+++ b/TelegramBots.wiki/abilities/Simple-Example.md
@@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies.
org.telegramtelegrambots-abilties
- 3.5
+ 3.6
```
* **Gradle**
```groovy
- compile group: 'org.telegram', name: 'telegrambots-abilties', version: '3.5'
+ compile group: 'org.telegram', name: 'telegrambots-abilties', version: '3.6'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)
diff --git a/pom.xml b/pom.xml
index 8a836e48..dc751700 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
org.telegramBotspom
- 3.5
+ 3.6telegrambots
@@ -26,6 +26,6 @@
true
- 3.5
+ 3.6
\ No newline at end of file
diff --git a/telegrambots-abilities/README.md b/telegrambots-abilities/README.md
index 7819d41f..8b01640f 100644
--- a/telegrambots-abilities/README.md
+++ b/telegrambots-abilities/README.md
@@ -18,19 +18,19 @@ Usage
org.telegramtelegrambots-abilities
- 3.5
+ 3.6
```
**Gradle**
```gradle
- compile "org.telegram:telegrambots-abilities:3.5"
+ compile "org.telegram:telegrambots-abilities:3.6"
```
-**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v3.5)
+**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v3.6)
-**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.5)
+**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v3.6)
Motivation
----------
diff --git a/telegrambots-abilities/pom.xml b/telegrambots-abilities/pom.xml
index bd9d85ef..c89607e7 100644
--- a/telegrambots-abilities/pom.xml
+++ b/telegrambots-abilities/pom.xml
@@ -5,7 +5,7 @@
4.0.0org.telegramtelegrambots-abilities
- 3.5
+ 3.6jarTelegram Ability Bot
@@ -65,7 +65,7 @@
UTF-8UTF-8
- 3.5
+ 3.63.53.0.419.0
diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md
index be786b11..97dd6f2c 100644
--- a/telegrambots-extensions/README.md
+++ b/telegrambots-extensions/README.md
@@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
org.telegramtelegrambotsextensions
- 3.5
+ 3.6
```
2. Using Gradle:
```gradle
- compile "org.telegram:telegrambotsextensions:3.5"
+ compile "org.telegram:telegrambotsextensions:3.6"
```
\ No newline at end of file
diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml
index f0ff7aec..a6f41734 100644
--- a/telegrambots-extensions/pom.xml
+++ b/telegrambots-extensions/pom.xml
@@ -5,7 +5,7 @@
4.0.0org.telegramtelegrambotsextensions
- 3.5
+ 3.6jarTelegram Bots Extensions
@@ -59,7 +59,7 @@
UTF-8UTF-8
- 3.5
+ 3.6
diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml
index 3d08b64a..3bb47ed2 100644
--- a/telegrambots-meta/pom.xml
+++ b/telegrambots-meta/pom.xml
@@ -5,7 +5,7 @@
4.0.0org.telegramtelegrambots-meta
- 3.5
+ 3.6jarTelegram Bots Meta
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java
index 6f053266..e312a513 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendAudio.java
@@ -17,12 +17,11 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Use this method to send audio files, Use this method to send audio files, if you want
+ * Use this method to send audio files, Use this method to send audio files, if you want
* Telegram clients to display them in the music player. Your audio must be in an .mp3 format. On
* success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in
* size, this limit may be changed in the future.
* @note For sending voice notes, use sendVoice method instead.
- * @date 16 of July of 2015
*/
public class SendAudio extends PartialBotApiMethod {
public static final String PATH = "sendaudio";
@@ -36,6 +35,8 @@ public class SendAudio extends PartialBotApiMethod {
public static final String PERFOMER_FIELD = "performer";
public static final String TITLE_FIELD = "title";
public static final String CAPTION_FIELD = "caption";
+ public static final String PARSEMODE_FIELD = "parse_mode";
+
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)
@@ -46,6 +47,7 @@ public class SendAudio extends PartialBotApiMethod {
private String performer; ///< Optional. Performer of sent audio
private String title; ///< Optional. Title of sent audio
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewAudio; ///< True to upload a new audio, false to use a fileId
private String audioName;
@@ -191,6 +193,15 @@ public class SendAudio extends PartialBotApiMethod {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public SendAudio setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@@ -239,11 +250,12 @@ public class SendAudio extends PartialBotApiMethod {
", replyMarkup=" + replyMarkup +
", performer='" + performer + '\'' +
", title='" + title + '\'' +
+ ", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
", isNewAudio=" + isNewAudio +
", audioName='" + audioName + '\'' +
", newAudioFile=" + newAudioFile +
", newAudioStream=" + newAudioStream +
- ", caption='" + caption + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java
index c9bdc664..4923de82 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendDocument.java
@@ -17,8 +17,7 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Use this method to send general files. On success, the sent Message is returned.
- * @date 20 of June of 2015
+ * Use this method to send general files. On success, the sent Message is returned.
*/
public class SendDocument extends PartialBotApiMethod {
public static final String PATH = "senddocument";
@@ -29,12 +28,15 @@ public class SendDocument extends PartialBotApiMethod {
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
+ public static final String PARSEMODE_FIELD = "parse_mode";
+
private String chatId; ///< Unique identifier for the chat to send the message to or Username for the channel to send the message to
private String document; ///< File file to send. file_id as String to resend a file that is already on the Telegram servers or Url to upload it
private String caption; ///< Optional. Document caption (may also be used when resending documents by file_id), 0-200 characters
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
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 String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewDocument; ///< True to upload a new document, false to use a fileId
private String documentName;
@@ -154,6 +156,15 @@ public class SendDocument extends PartialBotApiMethod {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public SendDocument setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@@ -196,9 +207,15 @@ public class SendDocument extends PartialBotApiMethod {
return "SendDocument{" +
"chatId='" + chatId + '\'' +
", document='" + document + '\'' +
+ ", caption='" + caption + '\'' +
+ ", disableNotification=" + disableNotification +
", replyToMessageId=" + replyToMessageId +
", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
", isNewDocument=" + isNewDocument +
+ ", documentName='" + documentName + '\'' +
+ ", newDocumentFile=" + newDocumentFile +
+ ", newDocumentStream=" + newDocumentStream +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java
index c956b665..e8ebec83 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendPhoto.java
@@ -17,8 +17,7 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Use this method to send photos. On success, the sent Message is returned.
- * @date 20 of June of 2015
+ * Use this method to send photos. On success, the sent Message is returned.
*/
public class SendPhoto extends PartialBotApiMethod {
public static final String PATH = "sendphoto";
@@ -29,12 +28,15 @@ public class SendPhoto extends PartialBotApiMethod {
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
+ public static final String PARSEMODE_FIELD = "parse_mode";
+
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
private String photo; ///< Photo to send. file_id as String to resend a photo that is already on the Telegram servers or URL to upload it
private String caption; ///< Optional Photo caption (may also be used when resending photos by file_id).
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
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 String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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
@@ -142,6 +144,15 @@ public class SendPhoto extends PartialBotApiMethod {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public SendPhoto setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@@ -184,9 +195,14 @@ public class SendPhoto extends PartialBotApiMethod {
"chatId='" + chatId + '\'' +
", photo='" + photo + '\'' +
", caption='" + caption + '\'' +
+ ", disableNotification=" + disableNotification +
", replyToMessageId=" + replyToMessageId +
", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
", isNewPhoto=" + isNewPhoto +
+ ", photoName='" + photoName + '\'' +
+ ", newPhotoFile=" + newPhotoFile +
+ ", newPhotoStream=" + newPhotoStream +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java
index f999e221..ffdec937 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVideo.java
@@ -31,17 +31,22 @@ public class SendVideo extends PartialBotApiMethod {
public static final String WIDTH_FIELD = "width";
public static final String HEIGHT_FIELD = "height";
public static final String DISABLENOTIFICATION_FIELD = "disable_notification";
+ public static final String SUPPORTSSTREAMING_FIELD = "supports_streaming";
public static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
public static final String REPLYMARKUP_FIELD = "reply_markup";
+ public static final String PARSEMODE_FIELD = "parse_mode";
+
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
private String video; ///< Video to send. file_id as String to resend a video that is already on the Telegram servers or URL to upload it
private Integer duration; ///< Optional. Duration of sent video in seconds
private String caption; ///< OptionaL. Video caption (may also be used when resending videos by file_id).
private Integer width; ///< Optional. Video width
private Integer height; ///< OptionaL. Video height
+ private Boolean supportsStreaming; ///< Optional. Pass True, if the uploaded video is suitable for streaming
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
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 String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewVideo; ///< True to upload a new video, false to use a fileId
private String videoName; ///< Name of the video
@@ -176,6 +181,24 @@ public class SendVideo extends PartialBotApiMethod {
return this;
}
+ public Boolean getSupportsStreaming() {
+ return supportsStreaming;
+ }
+
+ public SendVideo setSupportsStreaming(Boolean supportsStreaming) {
+ this.supportsStreaming = supportsStreaming;
+ return this;
+ }
+
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public SendVideo setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java
index ca5bd11e..25b493a5 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/send/SendVoice.java
@@ -17,10 +17,9 @@ import java.util.Objects;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Use this method to send voice notes, if you want Telegram clients to display the file as a
+ * Use this method to send voice notes, if you want Telegram clients to display the file as a
* playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS
* (other formats may be sent as Audio or Document).
- * @date 16 of July of 2015
*/
public class SendVoice extends PartialBotApiMethod {
public static final String PATH = "sendvoice";
@@ -32,6 +31,7 @@ public class SendVoice extends PartialBotApiMethod {
public static final String REPLYMARKUP_FIELD = "reply_markup";
public static final String DURATION_FIELD = "duration";
public static final String CAPTION_FIELD = "caption";
+ public static final String PARSEMODE_FIELD = "parse_mode";
private String chatId; ///< Unique identifier for the chat sent message to (Or username for channels)
private String voice; ///< Audio file to send. You can either pass a file_id as String to resend an audio that is already on the Telegram servers, or upload a new audio file using multipart/form-data.
@@ -40,6 +40,7 @@ public class SendVoice extends PartialBotApiMethod {
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
private Integer duration; ///< Optional. Duration of sent audio in seconds
private String caption; ///< Optional. Voice caption (may also be used when resending videos by file_id).
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
private boolean isNewVoice; ///< True to upload a new voice note, false to use a fileId
private String voiceName; ///< Name of the voice note
@@ -156,6 +157,15 @@ public class SendVoice extends PartialBotApiMethod {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public SendVoice setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
try {
@@ -203,6 +213,7 @@ public class SendVoice extends PartialBotApiMethod {
", replyMarkup=" + replyMarkup +
", duration=" + duration +
", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
", isNewVoice=" + isNewVoice +
", voiceName='" + voiceName + '\'' +
", newVoiceFile=" + newVoiceFile +
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageCaption.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageCaption.java
index cba6e216..2a4414d7 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageCaption.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/methods/updatingmessages/EditMessageCaption.java
@@ -16,9 +16,8 @@ import java.io.Serializable;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Use this method to edit captions of messages sent by the bot or via the bot (for inline
+ * Use this method to edit captions of messages sent by the bot or via the bot (for inline
* bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
- * @date 10 of April of 2016
*/
public class EditMessageCaption extends BotApiMethod {
public static final String PATH = "editmessagecaption";
@@ -28,6 +27,7 @@ public class EditMessageCaption extends BotApiMethod {
private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id";
private static final String CAPTION_FIELD = "caption";
private static final String REPLYMARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
/**
* Required if inline_message_id is not specified. Unique identifier for the chat to send the
@@ -49,6 +49,8 @@ public class EditMessageCaption extends BotApiMethod {
private String caption; ///< Optional. New caption of the message
@JsonProperty(REPLYMARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard.
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public EditMessageCaption() {
super();
@@ -99,6 +101,15 @@ public class EditMessageCaption extends BotApiMethod {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public EditMessageCaption setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public String getMethod() {
return PATH;
@@ -155,11 +166,12 @@ public class EditMessageCaption extends BotApiMethod {
@Override
public String toString() {
return "EditMessageCaption{" +
- "chatId=" + chatId +
+ "chatId='" + chatId + '\'' +
", messageId=" + messageId +
- ", inlineMessageId=" + inlineMessageId +
- ", caption=" + caption +
+ ", inlineMessageId='" + inlineMessageId + '\'' +
+ ", caption='" + caption + '\'' +
", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
index ee255316..76d56c1e 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java
@@ -56,6 +56,7 @@ public class Message implements BotApiObject {
private static final String AUTHORSIGNATURE_FIELD = "author_signature";
private static final String FORWARDSIGNATURE_FIELD = "forward_signature";
private static final String MEDIAGROUPID_FIELD = "media_group_id";
+ private static final String CONNECTEDWEBSITE_FIELD = "connected_website";
@JsonProperty(MESSAGEID_FIELD)
private Integer messageId; ///< Integer Unique message identifier
@@ -174,7 +175,9 @@ public class Message implements BotApiObject {
@JsonProperty(FORWARDSIGNATURE_FIELD)
private String forwardSignature; ///< Optional. Post author signature for messages forwarded from channel chats
@JsonProperty(MEDIAGROUPID_FIELD)
- private String mediaGroupId;
+ private String mediaGroupId; ///< Optional. The unique identifier of a media message group this message belongs to
+ @JsonProperty(CONNECTEDWEBSITE_FIELD)
+ private String connectedWebsite; ///< Optional. The domain name of the website on which the user has logged in
public Message() {
super();
@@ -418,6 +421,10 @@ public class Message implements BotApiObject {
return mediaGroupId;
}
+ public String getConnectedWebsite() {
+ return connectedWebsite;
+ }
+
@Override
public String toString() {
return "Message{" +
@@ -462,6 +469,7 @@ public class Message implements BotApiObject {
", authorSignature='" + authorSignature + '\'' +
", forwardSignature='" + forwardSignature + '\'' +
", mediaGroupId='" + mediaGroupId + '\'' +
+ ", connectedWebsite='" + connectedWebsite + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultAudio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultAudio.java
index 9cb42c4b..0a408ed4 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultAudio.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultAudio.java
@@ -9,12 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to an mp3 audio file. By default, this audio file will be sent by the
+ * Represents a link to an mp3 audio file. By default, this audio file will be sent by the
* user. Alternatively, you can use input_message_content to send a message with the specified
* content instead of the audio.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
- * @date 10 of April of 2016
*/
public class InlineQueryResultAudio implements InlineQueryResult {
@@ -27,6 +26,7 @@ public class InlineQueryResultAudio implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "audio"; ///< Type of the result, must be "audio"
@@ -46,6 +46,8 @@ public class InlineQueryResultAudio implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultAudio() {
super();
@@ -127,6 +129,15 @@ public class InlineQueryResultAudio implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultAudio setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -146,7 +157,8 @@ public class InlineQueryResultAudio implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultAudio{" +
- "id='" + id + '\'' +
+ "type='" + type + '\'' +
+ ", id='" + id + '\'' +
", audioUrl='" + audioUrl + '\'' +
", title='" + title + '\'' +
", performer='" + performer + '\'' +
@@ -154,6 +166,7 @@ public class InlineQueryResultAudio implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultDocument.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultDocument.java
index a63f8dc6..e5b0c9ef 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultDocument.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultDocument.java
@@ -9,13 +9,12 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a file. By default, this file will be sent by the user with an
+ * Represents a link to a file. By default, this file will be sent by the user with an
* optional caption. Alternatively, you can use input_message_content to send a message with the
* specified content instead of the file.
* @note Currently, only .PDF and .ZIP files can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
- * @date 01 of January of 2016
*/
public class InlineQueryResultDocument implements InlineQueryResult {
@@ -31,6 +30,7 @@ public class InlineQueryResultDocument implements InlineQueryResult {
private static final String THUMBURL_FIELD = "thumb_url";
private static final String THUMBWIDTH_FIELD = "thumb_width";
private static final String THUMBHEIGHT_FIELD = "thumb_height";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "document"; ///< Type of the result, must be "document"
@@ -56,6 +56,8 @@ public class InlineQueryResultDocument implements InlineQueryResult {
private Integer thumbWidth; ///< Optional. Thumbnail width
@JsonProperty(THUMBHEIGHT_FIELD)
private Integer thumbHeight; ///< Optional. Thumbnail height
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultDocument() {
super();
@@ -164,6 +166,15 @@ public class InlineQueryResultDocument implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultDocument setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -191,16 +202,17 @@ public class InlineQueryResultDocument implements InlineQueryResult {
return "InlineQueryResultDocument{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
- ", mimeType='" + mimeType + '\'' +
- ", documentUrl='" + documentUrl + '\'' +
- ", thumbHeight=" + thumbHeight +
- ", thumbWidth=" + thumbWidth +
- ", thumbUrl='" + thumbUrl + '\'' +
", title='" + title + '\'' +
+ ", documentUrl='" + documentUrl + '\'' +
+ ", mimeType='" + mimeType + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", replyMarkup=" + replyMarkup +
+ ", inputMessageContent=" + inputMessageContent +
+ ", thumbUrl='" + thumbUrl + '\'' +
+ ", thumbWidth=" + thumbWidth +
+ ", thumbHeight=" + thumbHeight +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultGif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultGif.java
index 5904adc1..294a85bd 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultGif.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultGif.java
@@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to an animated GIF file. By default, this animated GIF file will be sent
+ * Represents a link to an animated GIF file. By default, this animated GIF file will be sent
* by the user with optional caption. Alternatively, you can use input_message_content to send a
* message with the specified content instead of the animation.
- * @date 01 of January of 2016
*/
public class InlineQueryResultGif implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String GIFURL_FIELD = "gif_url";
@@ -27,6 +25,7 @@ public class InlineQueryResultGif implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String GIF_DURATION_FIELD = "gif_duration";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "gif"; ///< Type of the result, must be "gif"
@@ -50,6 +49,8 @@ public class InlineQueryResultGif implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(GIF_DURATION_FIELD)
private Integer gifDuration; ///< Optional. Duration of the GIF
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultGif() {
super();
@@ -144,8 +145,18 @@ public class InlineQueryResultGif implements InlineQueryResult {
return gifDuration;
}
- public void setGifDuration(Integer gifDuration) {
+ public InlineQueryResultGif setGifDuration(Integer gifDuration) {
this.gifDuration = gifDuration;
+ return this;
+ }
+
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultGif setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
}
@Override
@@ -178,6 +189,7 @@ public class InlineQueryResultGif implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", gifDuration=" + gifDuration +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultMpeg4Gif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultMpeg4Gif.java
index 015094f7..d72e66e9 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultMpeg4Gif.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultMpeg4Gif.java
@@ -27,6 +27,7 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String MPEG4_DURATION_FIELD = "mpeg4_duration";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "mpeg4_gif"; ///< Type of the result, must be "mpeg4_gif"
@@ -50,6 +51,8 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(MPEG4_DURATION_FIELD)
private Integer mpeg4Duration; ///< Optional. Video duration
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultMpeg4Gif() {
super();
@@ -144,8 +147,18 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
return mpeg4Duration;
}
- public void setMpeg4Duration(Integer mpeg4Duration) {
+ public InlineQueryResultMpeg4Gif setMpeg4Duration(Integer mpeg4Duration) {
this.mpeg4Duration = mpeg4Duration;
+ return this;
+ }
+
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultMpeg4Gif setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
}
@Override
@@ -178,6 +191,7 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", mpeg4Duration=" + mpeg4Duration +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultPhoto.java
index e9d6490d..cfe9fc65 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultPhoto.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultPhoto.java
@@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a photo. By default, this photo will be sent by the user with
+ * Represents a link to a photo. By default, this photo will be sent by the user with
* optional caption. Alternatively, you can use input_message_content to send a message with the
* specified content instead of the photo.
- * @date 01 of January of 2016
*/
public class InlineQueryResultPhoto implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String PHOTOURL_FIELD = "photo_url";
@@ -28,6 +26,7 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "photo"; ///< Type of the result, must be “photo”
@@ -53,6 +52,8 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultPhoto() {
super();
@@ -161,6 +162,15 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultPhoto setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -190,8 +200,9 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVideo.java
index 30978694..46ac1f41 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVideo.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVideo.java
@@ -9,13 +9,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents link to a page containing an embedded video player or a video file.
+ * Represents link to a page containing an embedded video player or a video file.
* Alternatively, you can use input_message_content to send a message with the specified content
* instead of the video.
- * @date 01 of January of 2016
*/
public class InlineQueryResultVideo implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String MIMETYPE_FIELD = "mime_type";
@@ -29,6 +27,7 @@ public class InlineQueryResultVideo implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "video"; ///< Type of the result, must be "video"
@@ -56,6 +55,8 @@ public class InlineQueryResultVideo implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultVideo() {
super();
@@ -173,6 +174,15 @@ public class InlineQueryResultVideo implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultVideo setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -203,8 +213,9 @@ public class InlineQueryResultVideo implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVoice.java
index 8cab871f..7ba42e71 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVoice.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultVoice.java
@@ -9,15 +9,13 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a voice recording in an .ogg container encoded with OPUS. By default,
+ * Represents a link to a voice recording in an .ogg container encoded with OPUS. By default,
* this voice recording will be sent by the user. Alternatively, you can use input_message_content
* to send a message with the specified content instead of the the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
- * @date 10 of April of 2016
*/
public class InlineQueryResultVoice implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VOICEURL_FIELD = "voice_url";
@@ -26,6 +24,7 @@ public class InlineQueryResultVoice implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "voice"; ///< Type of the result, must be "voice"
@@ -43,6 +42,8 @@ public class InlineQueryResultVoice implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Voice caption (may also be used when resending documents by file_id), 0-200 characters
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultVoice() {
super();
@@ -134,13 +135,15 @@ public class InlineQueryResultVoice implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultVoice{" +
- "id='" + id + '\'' +
+ "type='" + type + '\'' +
+ ", id='" + id + '\'' +
", voiceUrl='" + voiceUrl + '\'' +
", title='" + title + '\'' +
", voiceDuration=" + voiceDuration +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java
index 3478e0ba..179576f0 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java
@@ -25,6 +25,7 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "audio"; ///< Type of the result, must be "audio"
@@ -38,6 +39,8 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedAudio() {
super();
@@ -92,6 +95,15 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedAudio setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -111,11 +123,13 @@ public class InlineQueryResultCachedAudio implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultCachedAudio{" +
- "id='" + id + '\'' +
+ "type='" + type + '\'' +
+ ", id='" + id + '\'' +
", audioFileId='" + audioFileId + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java
index 5d0bdbbd..2aef452d 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java
@@ -10,13 +10,12 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a file stored on the Telegram servers. By default, this file will be
+ * Represents a link to a file stored on the Telegram servers. By default, this file will be
* sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the file.
* @note Currently, only pdf-files and zip archives can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
- * @date 10 of April of 2016
*/
public class InlineQueryResultCachedDocument implements InlineQueryResult {
@@ -28,6 +27,7 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "document"; ///< Type of the result, must be "document"
@@ -45,6 +45,8 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the file
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedDocument() {
super();
@@ -117,6 +119,15 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedDocument setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -141,12 +152,13 @@ public class InlineQueryResultCachedDocument implements InlineQueryResult {
return "InlineQueryResultCachedDocument{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
- ", documentFileId='" + documentFileId + '\'' +
- ", caption='" + caption + '\'' +
", title='" + title + '\'' +
+ ", documentFileId='" + documentFileId + '\'' +
", description='" + description + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", caption='" + caption + '\'' +
+ ", replyMarkup=" + replyMarkup +
+ ", inputMessageContent=" + inputMessageContent +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java
index 9c8e4a75..fa184357 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java
@@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to an animated GIF file stored on the Telegram servers. By default, this
+ * Represents a link to an animated GIF file stored on the Telegram servers. By default, this
* animated GIF file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with specified content instead of the animation.
- * @date 10 of April of 2016
*/
public class InlineQueryResultCachedGif implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String GIF_FILE_ID_FIELD = "gif_file_id";
@@ -24,6 +22,7 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "gif"; ///< Type of the result, must be "gif"
@@ -39,6 +38,8 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the GIF animation
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedGif() {
super();
@@ -102,6 +103,15 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedGif setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -123,11 +133,12 @@ public class InlineQueryResultCachedGif implements InlineQueryResult {
return "InlineQueryResultCachedGif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
- ", gifUrl='" + gifFileId + '\'' +
+ ", gifFileId='" + gifFileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java
index cf840cc4..08d61904 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java
@@ -24,6 +24,7 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "mpeg4_gif"; ///< Type of the result, must be "mpeg4_gif"
@@ -39,6 +40,8 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedMpeg4Gif() {
super();
@@ -102,6 +105,15 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedMpeg4Gif setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -123,11 +135,12 @@ public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
return "InlineQueryResultCachedMpeg4Gif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
- ", mpeg4Url='" + mpeg4FileId + '\'' +
+ ", mpeg4FileId='" + mpeg4FileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java
index b15b5146..3e42d5b6 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java
@@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a photo stored on the Telegram servers. By default, this photo will
+ * Represents a link to a photo stored on the Telegram servers. By default, this photo will
* be sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the photo.
- * @date 10 of April of 2016
*/
public class InlineQueryResultCachedPhoto implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String PHOTOFILEID_FIELD = "photo_file_id";
@@ -25,6 +23,7 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "photo"; ///< Type of the result, must be “photo”
@@ -42,6 +41,8 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedPhoto() {
super();
@@ -114,6 +115,15 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedPhoto setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -139,8 +149,9 @@ public class InlineQueryResultCachedPhoto implements InlineQueryResult {
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java
index c0a526fb..71d3af36 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java
@@ -10,13 +10,11 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a video file stored on the Telegram servers. By default, this video
+ * Represents a link to a video file stored on the Telegram servers. By default, this video
* file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with the specified content instead of the video.
- * @date 10 of April of 2016
*/
public class InlineQueryResultCachedVideo implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VIDEO_FILE_ID_FIELD = "video_file_id";
@@ -25,6 +23,7 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "video"; ///< Type of the result, must be "video"
@@ -42,6 +41,8 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVideo() {
super();
@@ -114,6 +115,15 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedVideo setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -135,12 +145,13 @@ public class InlineQueryResultCachedVideo implements InlineQueryResult {
return "InlineQueryResultCachedVideo{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
- ", caption='" + caption + '\'' +
", videoFileId='" + videoFileId + '\'' +
", title='" + title + '\'' +
", description='" + description + '\'' +
- ", inputMessageContent='" + inputMessageContent + '\'' +
- ", replyMarkup='" + replyMarkup + '\'' +
+ ", caption='" + caption + '\'' +
+ ", inputMessageContent=" + inputMessageContent +
+ ", replyMarkup=" + replyMarkup +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java
index 5a3539d2..665e25bd 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java
@@ -10,15 +10,13 @@ import org.telegram.telegrambots.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
- * @brief Represents a link to a voice message stored on the Telegram servers. By default, this
+ * Represents a link to a voice message stored on the Telegram servers. By default, this
* voice message will be sent by the user. Alternatively, you can use input_message_content to send
* a message with the specified content instead of the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
- * @date 10 of April of 2016
*/
public class InlineQueryResultCachedVoice implements InlineQueryResult {
-
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VOICE_FILE_ID_FIELD = "voice_file_id";
@@ -26,6 +24,7 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "voice"; ///< Type of the result, must be "voice"
@@ -41,6 +40,8 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Voice caption (may also be used when resending documents by file_id), 0-200 characters
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVoice() {
super();
@@ -104,6 +105,15 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InlineQueryResultCachedVoice setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
@@ -123,12 +133,14 @@ public class InlineQueryResultCachedVoice implements InlineQueryResult {
@Override
public String toString() {
return "InlineQueryResultCachedVoice{" +
- "id='" + id + '\'' +
+ "type='" + type + '\'' +
+ ", id='" + id + '\'' +
", voiceFileId='" + voiceFileId + '\'' +
", title='" + title + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
+ ", parseMode='" + parseMode + '\'' +
'}';
}
}
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMedia.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMedia.java
index ff1a0ce2..327ffe32 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMedia.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMedia.java
@@ -17,6 +17,7 @@ public abstract class InputMedia implements InputBotApiObject, Validable {
protected static final String TYPE_FIELD = "type";
private static final String MEDIA_FIELD = "media";
private static final String CAPTION_FIELD = "caption";
+ private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(MEDIA_FIELD)
/**
@@ -27,7 +28,8 @@ public abstract class InputMedia implements InputBotApiObject, Validable {
private String media;
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the media to be sent, 0-200 characters
-
+ @JsonProperty(PARSEMODE_FIELD)
+ private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
@JsonIgnore
private boolean isNewMedia; ///< True to upload a new media, false to use a fileId or URL
@JsonIgnore
@@ -113,6 +115,15 @@ public abstract class InputMedia implements InputBotApiObject, Validable {
return this;
}
+ public String getParseMode() {
+ return parseMode;
+ }
+
+ public InputMedia setParseMode(String parseMode) {
+ this.parseMode = parseMode;
+ return this;
+ }
+
@Override
public void validate() throws TelegramApiValidationException {
if (isNewMedia) {
diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMediaVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMediaVideo.java
index 94475198..a4d90f2e 100644
--- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMediaVideo.java
+++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/media/InputMediaVideo.java
@@ -16,6 +16,7 @@ public class InputMediaVideo extends InputMedia {
private static final String WIDTH_FIELD = "width";
private static final String HEIGHT_FIELD = "height";
private static final String DURATION_FIELD = "duration";
+ private static final String SUPPORTSSTREAMING_FIELD = "supports_streaming";
@JsonProperty(WIDTH_FIELD)
private int width; ///< Optional. Video width
@@ -23,6 +24,8 @@ public class InputMediaVideo extends InputMedia {
private int height; ///< Optional. Video height
@JsonProperty(DURATION_FIELD)
private int duration; ///< Optional. Video duration
+ @JsonProperty(SUPPORTSSTREAMING_FIELD)
+ private Boolean supportsStreaming; ///< Optional. Pass True, if the uploaded video is suitable for streaming
public InputMediaVideo() {
super();
diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml
index bf4ef83d..cf56f9bb 100644
--- a/telegrambots/pom.xml
+++ b/telegrambots/pom.xml
@@ -5,7 +5,7 @@
4.0.0org.telegramtelegrambots
- 3.5
+ 3.6jarTelegram Bots
@@ -66,7 +66,7 @@
2.8.72.8.02.5
- 3.5
+ 3.6
diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultAbsSender.java b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultAbsSender.java
index 4b3c9259..52d88b08 100644
--- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultAbsSender.java
+++ b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultAbsSender.java
@@ -157,6 +157,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendDocument.getCaption() != null) {
builder.addTextBody(SendDocument.CAPTION_FIELD, sendDocument.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
+ if (sendDocument.getParseMode() != null) {
+ builder.addTextBody(SendDocument.PARSEMODE_FIELD, sendDocument.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
+ }
}
if (sendDocument.getDisableNotification() != null) {
builder.addTextBody(SendDocument.DISABLENOTIFICATION_FIELD, sendDocument.getDisableNotification().toString(), TEXT_PLAIN_CONTENT_TYPE);
@@ -202,6 +205,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendPhoto.getCaption() != null) {
builder.addTextBody(SendPhoto.CAPTION_FIELD, sendPhoto.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
+ if (sendPhoto.getParseMode() != null) {
+ builder.addTextBody(SendPhoto.PARSEMODE_FIELD, sendPhoto.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
+ }
}
if (sendPhoto.getDisableNotification() != null) {
builder.addTextBody(SendPhoto.DISABLENOTIFICATION_FIELD, sendPhoto.getDisableNotification().toString(), TEXT_PLAIN_CONTENT_TYPE);
@@ -247,6 +253,12 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendVideo.getCaption() != null) {
builder.addTextBody(SendVideo.CAPTION_FIELD, sendVideo.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
+ if (sendVideo.getParseMode() != null) {
+ builder.addTextBody(SendVideo.PARSEMODE_FIELD, sendVideo.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
+ }
+ }
+ if (sendVideo.getSupportsStreaming() != null) {
+ builder.addTextBody(SendVideo.SUPPORTSSTREAMING_FIELD, sendVideo.getSupportsStreaming().toString(), TEXT_PLAIN_CONTENT_TYPE);
}
if (sendVideo.getDuration() != null) {
builder.addTextBody(SendVideo.DURATION_FIELD, sendVideo.getDuration().toString(), TEXT_PLAIN_CONTENT_TYPE);
@@ -408,6 +420,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendAudio.getCaption() != null) {
builder.addTextBody(SendAudio.CAPTION_FIELD, sendAudio.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
+ if (sendAudio.getParseMode() != null) {
+ builder.addTextBody(SendAudio.PARSEMODE_FIELD, sendAudio.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
+ }
}
HttpEntity multipart = builder.build();
httppost.setEntity(multipart);
@@ -462,6 +477,9 @@ public abstract class DefaultAbsSender extends AbsSender {
}
if (sendVoice.getCaption() != null) {
builder.addTextBody(SendVoice.CAPTION_FIELD, sendVoice.getCaption(), TEXT_PLAIN_CONTENT_TYPE);
+ if (sendVoice.getParseMode() != null) {
+ builder.addTextBody(SendVoice.PARSEMODE_FIELD, sendVoice.getParseMode(), TEXT_PLAIN_CONTENT_TYPE);
+ }
}
HttpEntity multipart = builder.build();
httppost.setEntity(multipart);