Skip to content

Commit

Permalink
Merge pull request rubenlagus#518 from rubenlagus/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rubenlagus authored Aug 30, 2018
2 parents 27e0751 + 01d3de4 commit ffc1f71
Show file tree
Hide file tree
Showing 24 changed files with 438 additions and 34 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ Just import add the library to your project with one of these options:
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>4.0.1</version>
<version>4.1</version>
</dependency>
```

```gradle
compile "org.telegram:telegrambots:4.0.1"
compile "org.telegram:telegrambots:4.1"
```

2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/4.0.1)
3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v4.0.1)
2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/4.1)
3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v4.1)

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

Expand Down
6 changes: 5 additions & 1 deletion TelegramBots.wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### <a id="4.0.0"></a>4.0.0 ###
### <a id="4.1"></a>4.1 ###
1. Support for Api Version [4.1](https://core.telegram.org/bots/api-changelog#august-27-2018)
2. Fix #507 and #512

### <a id="4.0.1"></a>4.0.1 ###
1. Fix bug #499

### <a id="4.0.0"></a>4.0.0 ###
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>4.0.1</version>
<version>4.1</version>
</dependency>
```
* With **Gradle**:

```groovy
compile group: 'org.telegram', name: 'telegrambots', version: '4.0.1'
compile group: 'org.telegram', name: 'telegrambots', version: '4.1'
```

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>4.0.1</version>
<version>4.1</version>
</dependency>
```
* **Gradle**
```groovy
compile group: 'org.telegram', name: 'telegrambots-abilties', version: '4.0.1'
compile group: 'org.telegram', name: 'telegrambots-abilties', version: '4.1'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

Expand Down
4 changes: 2 additions & 2 deletions 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>4.0.1</version>
<version>4.1</version>

<modules>
<module>telegrambots</module>
Expand All @@ -28,6 +28,6 @@

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<bots.version>4.0.1</bots.version>
<bots.version>4.1</bots.version>
</properties>
</project>
8 changes: 4 additions & 4 deletions telegrambots-abilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>4.0.1</version>
<version>4.1</version>
</dependency>
```

**Gradle**

```gradle
compile "org.telegram:telegrambots-abilities:4.0.1"
compile "org.telegram:telegrambots-abilities:4.1"
```

**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v4.0.1)
**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v4.1)

**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v4.0.1)
**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v4.1)

Motivation
----------
Expand Down
4 changes: 2 additions & 2 deletions telegrambots-abilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>4.0.1</version>
<version>4.1</version>
<packaging>jar</packaging>

<name>Telegram Ability Bot</name>
Expand Down Expand Up @@ -65,7 +65,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bots.version>4.0.1</bots.version>
<bots.version>4.1</bots.version>
<commonslang.version>3.5</commonslang.version>
<mapdb.version>3.0.4</mapdb.version>
<guava.version>19.0</guava.version>
Expand Down
2 changes: 1 addition & 1 deletion telegrambots-chat-session-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId>
<version>4.0.1</version>
<version>4.1</version>
</dependency>
```

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 @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId>
<version>4.0.1</version>
<version>4.1</version>
<packaging>jar</packaging>

<name>Telegram Bots Chat Session Bot</name>
Expand Down Expand Up @@ -65,7 +65,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bots.version>4.0.1</bots.version>
<bots.version>4.1</bots.version>
<shiro.version>1.4.0</shiro.version>
</properties>

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>4.0.1</version>
<version>4.1</version>
</dependency>
```

2. Using Gradle:

```gradle
compile "org.telegram:telegrambotsextensions:4.0.1"
compile "org.telegram:telegrambotsextensions:4.1"
```
4 changes: 2 additions & 2 deletions telegrambots-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambotsextensions</artifactId>
<version>4.0.1</version>
<version>4.1</version>
<packaging>jar</packaging>

<name>Telegram Bots Extensions</name>
Expand Down Expand Up @@ -59,7 +59,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bots.version>4.0.1</bots.version>
<bots.version>4.1</bots.version>
</properties>

<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 @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-meta</artifactId>
<version>4.0.1</version>
<version>4.1</version>
<packaging>jar</packaging>

<name>Telegram Bots Meta</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class SendAnimation extends PartialBotApiMethod<Message> {
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 String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
/**
* Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size.
* A thumbnail‘s width and height should not exceed 90.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @version 1.0
* This object represents a Telegram chat with an user or a group
*/
@SuppressWarnings("WeakerAccess")
public class Chat implements BotApiObject {

private static final String ID_FIELD = "id";
Expand Down Expand Up @@ -64,7 +65,7 @@ public class Chat implements BotApiObject {
@JsonProperty(STICKERSETNAME_FIELD)
private String stickerSetName; ///< Optional. For supergroups, name of Group sticker set. Returned only in getChat.
@JsonProperty(CANSETSTICKERSET_FIELD)
private Message canSetStickerSet; ///< Optional. True, if the bot can change group the sticker set. Returned only in getChat.
private Boolean canSetStickerSet; ///< Optional. True, if the bot can change group the sticker set. Returned only in getChat.

public Chat() {
super();
Expand Down Expand Up @@ -130,7 +131,7 @@ public String getStickerSetName() {
return stickerSetName;
}

public Message getCanSetStickerSet() {
public Boolean getCanSetStickerSet() {
return canSetStickerSet;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;

import java.util.ArrayList;
import java.util.List;

/**
Expand All @@ -20,6 +21,8 @@ public class EncryptedPassportElement implements BotApiObject {
private static final String FRONTSIDE_FIELD = "front_side";
private static final String REVERSESIDE_FIELD = "reverse_side";
private static final String SELFIE_FIELD = "selfie";
private static final String TRANSLATION_FIELD = "translation";
private static final String HASH_FIELD = "hash";

/**
* Data type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”,
Expand Down Expand Up @@ -68,6 +71,19 @@ public class EncryptedPassportElement implements BotApiObject {
*/
@JsonProperty(SELFIE_FIELD)
private PassportFile selfie;
/**
* Optional. Array of encrypted files with translated versions of documents provided by the user.
* Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”,
* “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
* Files can be decrypted and verified using the accompanying EncryptedCredentials.
*/
@JsonProperty(TRANSLATION_FIELD)
private ArrayList<PassportFile> translations;
/**
* Base64-encoded element hash for using in PassportElementErrorUnspecified
*/
@JsonProperty(HASH_FIELD)
private String hash;

public EncryptedPassportElement(String type, String data, String phoneNumber, String email, List<PassportFile> files,
PassportFile frontSide, PassportFile reverseSide, PassportFile selfie) {
Expand Down Expand Up @@ -116,6 +132,18 @@ public PassportFile getSelfie() {
return selfie;
}

public String getHash() {
return hash;
}

public boolean hasTranslations() {
return translations != null && !translations.isEmpty();
}

public ArrayList<PassportFile> getTranslations() {
return translations;
}

@Override
public String toString() {
return "EncryptedPassportElement{" +
Expand All @@ -127,6 +155,8 @@ public String toString() {
", frontSide=" + frontSide +
", reverseSide=" + reverseSide +
", selfie=" + selfie +
", translations=" + translations +
", hash='" + hash + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* PassportElementErrorSelfie
* PassportElementErrorFile
* PassportElementErrorFiles
* PassportElementErrorUnspecified
* PassportElementErrorTranslationFile
* PassportElementErrorTranslationFiles
*/
public interface PassportElementError extends InputBotApiObject, Validable {
}
Loading

0 comments on commit ffc1f71

Please sign in to comment.