Api Version 5.4
This commit is contained in:
parent
0c202ac134
commit
29cdebad8a
@ -31,7 +31,7 @@ public enum Flag implements Predicate<Update> {
|
|||||||
POLL_ANSWER(Update::hasPollAnswer),
|
POLL_ANSWER(Update::hasPollAnswer),
|
||||||
MY_CHAT_MEMBER(Update::hasMyChatMember),
|
MY_CHAT_MEMBER(Update::hasMyChatMember),
|
||||||
CHAT_MEMBER(Update::hasChatMember),
|
CHAT_MEMBER(Update::hasChatMember),
|
||||||
HAS_CHAT_JOIN_REQUEST(Update::hasChatJoinRequest),
|
CHAT_JOIN_REQUEST(Update::hasChatJoinRequest),
|
||||||
|
|
||||||
|
|
||||||
// Message Flags
|
// Message Flags
|
||||||
|
@ -86,6 +86,8 @@ public final class AbilityUtils {
|
|||||||
return update.getMyChatMember().getFrom();
|
return update.getMyChatMember().getFrom();
|
||||||
} else if (CHAT_MEMBER.test(update)) {
|
} else if (CHAT_MEMBER.test(update)) {
|
||||||
return update.getChatMember().getFrom();
|
return update.getChatMember().getFrom();
|
||||||
|
} else if (CHAT_JOIN_REQUEST.test(update)) {
|
||||||
|
return update.getChatJoinRequest().getUser();
|
||||||
} else if (POLL.test(update)) {
|
} else if (POLL.test(update)) {
|
||||||
return EMPTY_USER;
|
return EMPTY_USER;
|
||||||
} else {
|
} else {
|
||||||
@ -171,6 +173,8 @@ public final class AbilityUtils {
|
|||||||
return update.getMyChatMember().getChat().getId();
|
return update.getMyChatMember().getChat().getId();
|
||||||
} else if (CHAT_MEMBER.test(update)) {
|
} else if (CHAT_MEMBER.test(update)) {
|
||||||
return update.getChatMember().getChat().getId();
|
return update.getChatMember().getChat().getId();
|
||||||
|
} else if (CHAT_JOIN_REQUEST.test(update)) {
|
||||||
|
return update.getChatJoinRequest().getChat().getId();
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("Could not retrieve originating chat ID from update");
|
throw new IllegalStateException("Could not retrieve originating chat ID from update");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user