diff --git a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/AbilityBot.java b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/AbilityBot.java index bbabe4c3..c2024f46 100644 --- a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/AbilityBot.java +++ b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/bot/AbilityBot.java @@ -637,7 +637,7 @@ public abstract class AbilityBot extends TelegramLongPollingBot { Privacy privacy; int id = user.id(); - privacy = isCreator(id) ? CREATOR : isAdmin(id) ? ADMIN : isGroupAdmin(update, id)? GROUP_ADMIN : PUBLIC; + privacy = isCreator(id) ? CREATOR : isAdmin(id) ? ADMIN : (isGroupUpdate(update) || isSuperGroupUpdate(update)) && isGroupAdmin(update, id)? GROUP_ADMIN : PUBLIC; boolean isOk = privacy.compareTo(trio.b().privacy()) >= 0; 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 ff335720..29b26e01 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 @@ -362,7 +362,7 @@ public class AbilityBotTest { } @Test - public void canValidateGroupAdminPrivacy() throws TelegramApiException { + public void canValidateGroupAdminPrivacy() { Update update = mock(Update.class); Message message = mock(Message.class); org.telegram.telegrambots.api.objects.User user = mock(User.class); @@ -383,7 +383,7 @@ public class AbilityBotTest { } @Test - public void canRestrictNormalUsersFromGroupAdminAbilities() throws TelegramApiException { + public void canRestrictNormalUsersFromGroupAdminAbilities() { Update update = mock(Update.class); Message message = mock(Message.class); org.telegram.telegrambots.api.objects.User user = mock(User.class);