Skip to content

Commit

Permalink
Merge pull request #1233 from rubenlagus/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rubenlagus committed Jun 11, 2023
2 parents 79ecff7 + bfb1628 commit 7029a35
Show file tree
Hide file tree
Showing 164 changed files with 590 additions and 208 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>6.6.0</version>
<version>6.7.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambots:6.6.0'
implementation 'org.telegram:telegrambots:6.7.0'
```

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

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

Expand Down
5 changes: 5 additions & 0 deletions TelegramBots.wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### <a id="6.7.0"></a>6.7.0 ###
1. Update Api version [6.7](https://core.telegram.org/bots/api-changelog#april-21-2023)

**[[How to update to version 6.7.0|How-To-Update#6.7.0]]**

### <a id="6.6.0"></a>6.6.0 ###
1. Update Api version [6.6](https://core.telegram.org/bots/api-changelog#march-9-2023)

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 to acquire the library and add it to your project. There are seve
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.6.0</version>
<version>6.7.0</version>
</dependency>
```
* With **Gradle**:

```gradle
implementation 'org.telegram:telegrambots:6.6.0'
implementation 'org.telegram:telegrambots:6.7.0'
```

2. Don't like the **Maven Central Repository**? It can also be grabbed from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots).
Expand Down
7 changes: 7 additions & 0 deletions TelegramBots.wiki/How-To-Update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### <a id="6.7.0"></a>To version 6.7.0 ###
1. Api methods with thumbnails have changed the field, use getThumbnail()/setThumbnail() instead of getThumb()/setThumb()
2. In `AddStickerToSet`/`CreateNewStickerSet`/`UploadStickerFile`/etc, use field `sticker` instead of the deprecated fields.
3. `ChatMember` has more details permissions, use those instead of the legacy general ones.
4. All classes with mandatory fields will lose the default no-arg constructor in the future.
5. In `AnswerInlineQuery`, start using the `button` field instead of deprecated parameters.

### <a id="6.1.0"></a>To version 6.1.0 ###
1. As per API guidelines, FileSize can now have 64 bits size, hence they are now using Long datatype instead of Integer.
2. Methods accept chatId as Long or String.
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>6.6.0</version>
<version>6.7.0</version>
</dependency>
```
* **Gradle**
```gradle
implementation 'org.telegram:telegrambots-abilities:6.6.0'
implementation 'org.telegram:telegrambots-abilities:6.7.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>6.6.0</version>
<version>6.7.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>6.6.0</version>
<version>6.7.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-abilities:6.6.0'
implementation 'org.telegram:telegrambots-abilities:6.7.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>6.6.0</version>
<version>6.7.0</version>
</parent>

<artifactId>telegrambots-abilities</artifactId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.6.0</version>
<version>6.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import org.telegram.abilitybots.api.objects.Ability.AbilityBuilder;
import org.telegram.telegrambots.meta.api.objects.Update;

import java.util.function.Consumer;
import java.util.function.BiConsumer;
import java.util.function.Predicate;

import static java.util.Objects.nonNull;

/**
* Flags are an conditions that are applied on an {@link Update}.
* <p>
* They can be used on {@link AbilityBuilder#flag(Predicate[])} and on the post conditions in {@link AbilityBuilder#reply(Consumer, Predicate[])}.
* They can be used on {@link AbilityBuilder#flag(Predicate[])} and on the post conditions in {@link AbilityBuilder#reply(BiConsumer, Predicate[])}.
*
* @author Abbas Abou Daya
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

Expand All @@ -18,7 +17,7 @@
/**
* A reply consists of update conditionals and an action to be applied on the update.
* <p>
* If an update satisfies the {@link Reply#conditions} set by the reply, then it's safe to {@link Reply#actOn(Update)}.
* If an update satisfies the {@link Reply#conditions} set by the reply, then it's safe to {@link Reply#actOn(BaseAbilityBot, Update)}.
*
* @author Abbas Abou Daya
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.only;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

class SilentSenderTest {
private SilentSender silent;
Expand Down Expand Up @@ -55,7 +58,7 @@ void callsAsyncVariantOfExecute() throws TelegramApiException {
verify(sender, only()).executeAsync(methodObject, callback);
}

private class NoOpCallback implements SentCallback<Message> {
private static class NoOpCallback implements SentCallback<Message> {

@Override
public void onResult(BotApiMethod<Message> method, Message response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import org.telegram.abilitybots.api.bot.DefaultBot;
import org.telegram.abilitybots.api.db.DBContext;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Properties;

import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.telegram.abilitybots.api.db.MapDBContext.offlineInstance;

class CustomToggleTest {
Expand Down Expand Up @@ -55,7 +57,7 @@ public void canProcessAbilities() {
public void canTurnOffAbilitiesThroughProperties() {
Properties properties = new Properties();
try {
properties.load(new FileInputStream(filename));
properties.load(Files.newInputStream(Paths.get(filename)));
toggle = new CustomToggle().config(properties);
} catch (IOException e) {
System.out.println("No such file");
Expand All @@ -71,7 +73,7 @@ public void canTurnOffAbilitiesThroughProperties() {
public void canProcessAbilitiesThroughProperties() {
Properties properties = new Properties();
try {
properties.load(new FileInputStream(filename));
properties.load(Files.newInputStream(Paths.get(filename)));
toggle = new CustomToggle().config(properties);
} catch (IOException e) {
System.out.println("No such file");
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>6.6.0</version>
<version>6.7.0</version>
</dependency>
```

**Gradle**

```gradle
implementation 'org.telegram:telegrambots-chat-session-bot:6.6.0'
implementation 'org.telegram:telegrambots-chat-session-bot:6.7.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>6.6.0</version>
<version>6.7.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>6.6.0</version>
<version>6.7.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>6.6.0</version>
<version>6.7.0</version>
</dependency>
```

2. Using Gradle:

```gradle
implementation 'org.telegram:telegrambotsextensions:6.6.0'
implementation 'org.telegram:telegrambotsextensions:6.7.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>6.6.0</version>
<version>6.7.0</version>
</parent>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static String getHelpText(IBotCommand...botCommands) {
* @return a formatted String containing command and description for all supplied commands
*/
public static String getHelpText(Collection<IBotCommand> botCommands) {
return getHelpText(botCommands.toArray(new IBotCommand[botCommands.size()]));
return getHelpText(botCommands.toArray(new IBotCommand[0]));
}

/**
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>6.6.0</version>
<version>6.7.0</version>
</parent>

<artifactId>telegrambots-meta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Getter
@Setter
@ToString
@NoArgsConstructor
@NoArgsConstructor(force = true)
@RequiredArgsConstructor
@AllArgsConstructor
@Builder
Expand Down

0 comments on commit 7029a35

Please sign in to comment.