Skip to content

Commit

Permalink
Api Version 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenlagus committed Jan 1, 2022
1 parent 5c6bbbe commit feffffe
Show file tree
Hide file tree
Showing 39 changed files with 140 additions and 53 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots:5.5.0'
implementation 'org.telegram:telegrambots:5.6.0'
```

3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.5.0)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.5.0)
3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.6.0)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.6.0)

In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.

Expand Down
5 changes: 4 additions & 1 deletion TelegramBots.wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### <a id="5.6.0"></a>5.6.0 ###
1. Update Api version [5.6](https://core.telegram.org/bots/api-changelog#december-30-2021)

### <a id="5.5.0"></a>5.5.0 ###
1. Update Api version [5.5](https://core.telegram.org/bots/api#december-7-2021)
1. Update Api version [5.5](https://core.telegram.org/bots/api-changelog#december-7-2021)

### <a id="5.4.0.1"></a>5.4.0.1 ###
1. Bug fixing: #999, #1000
Expand Down
4 changes: 2 additions & 2 deletions TelegramBots.wiki/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ First you need ot get the library and add it to your project. There are few poss
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```
* With **Gradle**:

```gradle
implementation 'org.telegram:telegrambots:5.5.0'
implementation 'org.telegram:telegrambots:5.6.0'
```

2. Don't like **Maven Central Repository**? It can also be taken from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots).
Expand Down
4 changes: 2 additions & 2 deletions TelegramBots.wiki/abilities/Simple-Example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies.
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```
* **Gradle**
```gradle
implementation 'org.telegram:telegrambots-abilities:5.5.0'
implementation 'org.telegram:telegrambots-abilities:5.6.0'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<packaging>pom</packaging>
<version>5.5.0</version>
<version>5.6.0</version>

<modules>
<module>telegrambots</module>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-abilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-abilities:5.5.0'
implementation 'org.telegram:telegrambots-abilities:5.6.0'
```

**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1)
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-abilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</parent>

<artifactId>telegrambots-abilities</artifactId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-chat-session-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-chat-session-bot:5.5.0'
implementation 'org.telegram:telegrambots-chat-session-bot:5.6.0'
```

Motivation
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-chat-session-bot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</parent>

<artifactId>telegrambots-chat-session-bot</artifactId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambotsextensions:5.5.0'
implementation 'org.telegram:telegrambotsextensions:5.6.0'
```
4 changes: 2 additions & 2 deletions telegrambots-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</parent>

<artifactId>telegrambotsextensions</artifactId>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion telegrambots-meta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.5.0</version>
<version>5.6.0</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class CopyMessage extends BotApiMethod<MessageId> {
private static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String REPLYMARKUP_FIELD = "reply_markup";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand Down Expand Up @@ -85,6 +86,8 @@ public class CopyMessage extends BotApiMethod<MessageId> {
@JsonProperty(REPLYMARKUP_FIELD)
@JsonDeserialize()
private ReplyKeyboard replyMarkup;
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class ForwardMessage extends BotApiMethod<Message> {
private static final String FROMCHATID_FIELD = "from_chat_id";
private static final String MESSAGEID_FIELD = "message_id";
private static final String DISABLENOTIFICATION_FIELD = "disable_notification";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand All @@ -59,6 +60,8 @@ public class ForwardMessage extends BotApiMethod<Message> {
*/
@JsonProperty(DISABLENOTIFICATION_FIELD)
private Boolean disableNotification;
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

@Override
public void validate() throws TelegramApiValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class SendPoll extends BotApiMethod<Message> {
private static final String EXPLANATIONPARSEMODE_FIELD = "explanation_parse_mode";
private static final String EXPLANATION_ENTITIES_FIELD = "explanation_entities";
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String PROTECTCONTENT_FIELD = "protect_content";

/**
* Unique identifier for the target chat or username of the target channel (in the format @channelusername).
Expand Down Expand Up @@ -105,6 +106,8 @@ public class SendPoll extends BotApiMethod<Message> {
private List<MessageEntity> explanationEntities; ///< Optional. List of special entities that appear in the poll explanation, which can be specified instead of parse_mode
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -55,6 +56,7 @@ public class SendAnimation extends PartialBotApiMethod<Message> {
public static final String THUMB_FIELD = "thumb";
public static final String CAPTION_ENTITIES_FIELD = "caption_entities";
public static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
public static final String PROTECTCONTENT_FIELD = "protect_content";

@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
Expand Down Expand Up @@ -85,6 +87,7 @@ public class SendAnimation extends PartialBotApiMethod<Message> {
@Singular
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -56,6 +57,7 @@ public class SendAudio extends PartialBotApiMethod<Message> {
public static final String THUMB_FIELD = "thumb";
public static final String CAPTION_ENTITIES_FIELD = "caption_entities";
public static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
public static final String PROTECTCONTENT_FIELD = "protect_content";

@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to (or Username fro channels)
Expand All @@ -81,6 +83,7 @@ public class SendAudio extends PartialBotApiMethod<Message> {
@Singular
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class SendContact extends BotApiMethod<Message> {
private static final String REPLYMARKUP_FIELD = "reply_markup";
private static final String VCARD_FIELD = "vcard";
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand All @@ -68,6 +69,8 @@ public class SendContact extends BotApiMethod<Message> {
private String vCard; ///< Optional. Additional data about the contact in the form of a vCard
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SendDice extends BotApiMethod<Message> {
private static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
private static final String REPLYMARKUP_FIELD = "reply_markup";
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand All @@ -72,6 +73,8 @@ public class SendDice extends BotApiMethod<Message> {
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.telegram.telegrambots.meta.api.methods.send;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -50,6 +51,7 @@ public class SendDocument extends PartialBotApiMethod<Message> {
public static final String CAPTION_ENTITIES_FIELD = "caption_entities";
public static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
public static final String DISABLECONTENTTYPEDETECTION_FIELD = "disable_content_type_detection";
public static final String PROTECTCONTENT_FIELD = "protect_content";

@NonNull
private String chatId; ///< Unique identifier for the chat to send the message to or Username for the channel to send the message to
Expand All @@ -73,6 +75,7 @@ public class SendDocument extends PartialBotApiMethod<Message> {
private List<MessageEntity> captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
private Boolean disableContentTypeDetection; ///< Optional Disables automatic server-side content type detection for files uploaded using multipart/form-data
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class SendGame extends BotApiMethod<Message> {
private static final String REPLYTOMESSAGEID_FIELD = "reply_to_message_id";
private static final String REPLYMARKUP_FIELD = "reply_markup";
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand All @@ -74,6 +75,8 @@ public class SendGame extends BotApiMethod<Message> {
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
@JsonProperty(ALLOWSENDINGWITHOUTREPLY_FIELD)
private Boolean allowSendingWithoutReply; ///< Optional Pass True, if the message should be sent even if the specified replied-to message is not found
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class SendInvoice extends BotApiMethod<Message> {
private static final String ALLOWSENDINGWITHOUTREPLY_FIELD = "allow_sending_without_reply";
private static final String MAXTIPAMOUNT_FIELD = "max_tip_amount";
private static final String SUGGESTEDTIPAMOUNTS_FIELD = "suggested_tip_amounts";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand Down Expand Up @@ -161,6 +162,8 @@ public class SendInvoice extends BotApiMethod<Message> {
@JsonProperty(SUGGESTEDTIPAMOUNTS_FIELD)
@Singular
private List<Integer> suggestedTipAmounts;
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

@Override
public String getMethod() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SendLocation extends BotApiMethod<Message> {
private static final String HORIZONTALACCURACY_FIELD = "horizontal_accuracy";
private static final String HEADING_FIELD = "heading";
private static final String PROXIMITYALERTRADIUS_FIELD = "proximity_alert_radius";
private static final String PROTECTCONTENT_FIELD = "protect_content";

@JsonProperty(CHATID_FIELD)
@NonNull
Expand Down Expand Up @@ -87,6 +88,8 @@ public class SendLocation extends BotApiMethod<Message> {
*/
@JsonProperty(PROXIMITYALERTRADIUS_FIELD)
private Integer proximityAlertRadius;
@JsonProperty(PROTECTCONTENT_FIELD)
private Boolean protectContent; ///< Optional. Protects the contents of sent messages from forwarding and saving

public void enableNotification() {
this.disableNotification = false;
Expand Down
Loading

0 comments on commit feffffe

Please sign in to comment.