Api Version 5.4

This commit is contained in:
Ruben 2021-11-06 15:37:30 +00:00
parent 0c202ac134
commit 29cdebad8a
2 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@ public enum Flag implements Predicate<Update> {
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

View File

@ -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");
}