From da0a69309b3a8d33212bab3d6436d27cff4d3913 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Wed, 22 Jun 2022 23:41:51 +0200 Subject: [PATCH] Bugfixes --- .../abilitybots/api/bot/AbilityBotTest.java | 2 +- .../abilitybots/api/bot/TestUtils.java | 37 +------------------ .../telegrambots/meta/api/objects/Chat.java | 4 ++ 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java index 2bfb9635..aedc0438 100644 --- a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java +++ b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/AbilityBotTest.java @@ -373,7 +373,7 @@ public class AbilityBotTest { String newFirstName = USER.getFirstName() + "-test"; String newLastName = USER.getLastName() + "-test"; long sameId = USER.getId(); - User changedUser = new User(sameId, newFirstName, false, newLastName, newUsername, "en", false, false, false, false, false); + User changedUser = new User(sameId, newFirstName, false, newLastName, newUsername, "en", false, false, false, false, false, false, false, false, false, false, false); mockAlternateUser(update, message, changedUser); diff --git a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/TestUtils.java b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/TestUtils.java index 369d3cfa..e97d19db 100644 --- a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/TestUtils.java +++ b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/TestUtils.java @@ -11,41 +11,8 @@ import org.telegram.telegrambots.meta.api.objects.Update; import org.telegram.telegrambots.meta.api.objects.User; public final class TestUtils { - public static final User USER = new User(1L, "first", false, "last", "username", null, false, false, false, false, false); - public static final User CREATOR = new User(1337L, "creatorFirst", false, "creatorLast", "creatorUsername", null, false, false, false, false, false); - - public static final User USER = new User(1L, - "first", - false, - "last", - "username", - null, - false, - false, - false, - false, - false, - false, - false, - false, - false - ); - public static final User CREATOR = new User(1337L, - "creatorFirst", - false, - "creatorLast", - "creatorUsername", - null, - false, - false, - false, - false, - false, - false, - false, - false, - false - ); + public static final User USER = new User(1L, "first", false, "last", "username", null, false, false, false, false, false, false, false, false, false, false, false); + public static final User CREATOR = new User(1337L, "creatorFirst", false, "creatorLast", "creatorUsername", null, false, false, false, false, false, false, false, false, false, false, false); private TestUtils() { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java index a57d79d4..5e0819f4 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java @@ -56,6 +56,8 @@ public class Chat implements BotApiObject { private static final String SUPERGROUPCHATTYPE = "supergroup"; private static final String IS_VERIFIED_FIELD = "is_verified"; + + private static final String IS_PREMIUM_FIELD = "is_premium"; private static final String IS_SUPPORT_FIELD = "is_support"; private static final String IS_RESTRICTED_FIELD = "is_restricted"; private static final String IS_CREATOR_FIELD = "is_creator"; @@ -153,6 +155,8 @@ public class Chat implements BotApiObject { @JsonProperty(IS_VERIFIED_FIELD) private Boolean isVerified; ///< Optional. Extra. + @JsonProperty(IS_PREMIUM_FIELD) + private Boolean isPremium; ///< Optional. Extra. @JsonProperty(IS_SUPPORT_FIELD) private Boolean isSupport; ///< Optional. Extra. @JsonProperty(IS_CREATOR_FIELD)