Merge pull request #19 from rubenlagus/dev

Dev
This commit is contained in:
Andy Costanza 2021-03-31 17:09:17 +02:00 committed by GitHub
commit 3d924b883b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 38 additions and 34 deletions

View File

@ -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.0.1</version>
<version>5.1.1</version>
</dependency>
```
2. Using Gradle:
```gradle
implementation 'org.telegram:telegrambots:5.0.1'
implementation 'org.telegram:telegrambots:5.1.1'
```
3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.0.1)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.0.1)
3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.1.1)
4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.1.1)
In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`.

View File

@ -1,3 +1,6 @@
### <a id="5.1.1"></a>5.1.1 ###
1. Bug fixing: #874
### <a id="5.1.0"></a>5.1.0 ###
1. Update Api version [5.1](https://core.telegram.org/bots/api-changelog#march-9-2021)
2. Bug fixing: #832, #841, #844, #851, #857

View File

@ -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.0.1</version>
<version>5.1.1</version>
</dependency>
```
* With **Gradle**:
```gradle
implementation 'org.telegram:telegrambots:5.0.1'
implementation 'org.telegram:telegrambots:5.1.1'
```
2. Don't like **Maven Central Repository**? It can also be taken from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots).
@ -84,9 +84,10 @@ Now that we have the library, we can start coding. There are few steps to follow
public void onUpdateReceived(Update update) {
// We check if the update has a message and the message has text
if (update.hasMessage() && update.getMessage().hasText()) {
SendMessage message = new SendMessage() // Create a SendMessage object with mandatory fields
.setChatId(update.getMessage().getChatId())
.setText(update.getMessage().getText());
SendMessage message = new SendMessage(); // Create a SendMessage object with mandatory fields
message.setChatId(update.getMessage().getChatId().toString());
message.setText(update.getMessage().getText());
try {
execute(message); // Call method to send the message
} catch (TelegramApiException e) {

View File

@ -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.0.1</version>
<version>5.1.1</version>
</dependency>
```
* **Gradle**
```gradle
implementation 'org.telegram:telegrambots-abilities:5.0.1'
implementation 'org.telegram:telegrambots-abilities:5.1.1'
```
* [JitPack](https://jitpack.io/#rubenlagus/TelegramBots)

View File

@ -7,7 +7,7 @@
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<packaging>pom</packaging>
<version>5.1.0</version>
<version>5.1.1</version>
<modules>
<module>telegrambots</module>

View File

@ -18,14 +18,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-abilities</artifactId>
<version>5.0.1</version>
<version>5.1.1</version>
</dependency>
```
**Gradle**
```gradle
implementation 'org.telegram:telegrambots-abilities:5.0.1'
implementation 'org.telegram:telegrambots-abilities:5.1.1'
```
**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1)

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambots-abilities</artifactId>
@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

View File

@ -15,14 +15,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-chat-session-bot</artifactId>
<version>5.0.1</version>
<version>5.1.1</version>
</dependency>
```
**Gradle**
```gradle
implementation 'org.telegram:telegrambots-chat-session-bot:5.0.1'
implementation 'org.telegram:telegrambots-chat-session-bot:5.1.1'
```
Motivation

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambots-chat-session-bot</artifactId>
@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->

View File

@ -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.0.1</version>
<version>5.1.1</version>
</dependency>
```
2. Using Gradle:
```gradle
implementation 'org.telegram:telegrambotsextensions:5.0.1'
implementation 'org.telegram:telegrambotsextensions:5.1.1'
```

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambotsextensions</artifactId>
@ -75,7 +75,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambots-meta</artifactId>

View File

@ -39,7 +39,7 @@ import java.io.IOException;
@RequiredArgsConstructor
@Builder
public class EditChatInviteLink extends BotApiMethod<ChatInviteLink> {
public static final String PATH = "createChatInviteLink";
public static final String PATH = "editChatInviteLink";
private static final String CHATID_FIELD = "chat_id";
private static final String INVITELINK_FIELD = "invite_link";

View File

@ -39,7 +39,7 @@ import java.io.IOException;
@AllArgsConstructor
@Builder
public class RevokeChatInviteLink extends BotApiMethod<ChatInviteLink> {
public static final String PATH = "createChatInviteLink";
public static final String PATH = "revokeChatInviteLink";
private static final String CHATID_FIELD = "chat_id";
private static final String INVITELINK_FIELD = "invite_link";

View File

@ -18,14 +18,14 @@ Usage
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-spring-boot-starter</artifactId>
<version>5.0.1</version>
<version>5.1.1</version>
</dependency>
```
**Gradle**
```gradle
implementation 'org.telegram:telegrambots-spring-boot-starter:5.0.1'
implementation 'org.telegram:telegrambots-spring-boot-starter:5.1.1'
```
Motivation

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambots-spring-boot-starter</artifactId>
@ -70,7 +70,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<telegrambots.version>5.1.0</telegrambots.version>
<telegrambots.version>5.1.1</telegrambots.version>
<spring-boot.version>2.4.3</spring-boot.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</parent>
<artifactId>telegrambots</artifactId>
@ -92,7 +92,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots-meta</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>

View File

@ -41,7 +41,7 @@ public class DefaultBotOptions implements BotOptions {
baseUrl = ApiConstants.BASE_URL;
httpContext = HttpClientContext.create();
proxyType = ProxyType.NO_PROXY;
getUpdatesLimit = ApiConstants.GETUPDATES_TIMEOUT;
getUpdatesTimeout = ApiConstants.GETUPDATES_TIMEOUT;
getUpdatesLimit = 100;
}