diff --git a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/Flag.java b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/Flag.java index 27623fab..8b2303b5 100644 --- a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/Flag.java +++ b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/objects/Flag.java @@ -31,7 +31,7 @@ public enum Flag implements Predicate { POLL_ANSWER(Update::hasPollAnswer), MY_CHAT_MEMBER(Update::hasMyChatMember), CHAT_MEMBER(Update::hasChatMember), - HAS_CHAT_JOIN_REQUEST(Update::hasChatJoinRequest), + CHAT_JOIN_REQUEST(Update::hasChatJoinRequest), // Message Flags diff --git a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/util/AbilityUtils.java b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/util/AbilityUtils.java index 013ba41d..39f0f210 100644 --- a/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/util/AbilityUtils.java +++ b/telegrambots-abilities/src/main/java/org/telegram/abilitybots/api/util/AbilityUtils.java @@ -86,6 +86,8 @@ public final class AbilityUtils { return update.getMyChatMember().getFrom(); } else if (CHAT_MEMBER.test(update)) { return update.getChatMember().getFrom(); + } else if (CHAT_JOIN_REQUEST.test(update)) { + return update.getChatJoinRequest().getUser(); } else if (POLL.test(update)) { return EMPTY_USER; } else { @@ -171,6 +173,8 @@ public final class AbilityUtils { return update.getMyChatMember().getChat().getId(); } else if (CHAT_MEMBER.test(update)) { return update.getChatMember().getChat().getId(); + } else if (CHAT_JOIN_REQUEST.test(update)) { + return update.getChatJoinRequest().getChat().getId(); } else { throw new IllegalStateException("Could not retrieve originating chat ID from update"); }