From 837b4d236073715dd2fef85017ca718abdb4ec4d Mon Sep 17 00:00:00 2001 From: Bernhard Date: Tue, 17 Sep 2019 10:51:14 +0300 Subject: [PATCH] requested syntax changes --- .../org/telegram/abilitybots/api/objects/Flag.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 0bf5a905..3712dc9a 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 @@ -27,12 +27,12 @@ public enum Flag implements Predicate { CHOSEN_INLINE_QUERY(Update::hasChosenInlineQuery), // Message Flags - REPLY(upd -> upd.hasMessage() && upd.getMessage().isReply()), - DOCUMENT(upd -> upd.hasMessage() && upd.getMessage().hasDocument()), - TEXT(upd -> upd.hasMessage() && upd.getMessage().hasText()), - PHOTO(upd -> upd.hasMessage() && upd.getMessage().hasPhoto()), - LOCATION(upd -> upd.hasMessage() && upd.getMessage().hasLocation()), - CAPTION(upd -> upd.hasMessage() && nonNull(upd.getMessage().getCaption())); + REPLY(upd -> MESSAGE.test(upd) && upd.getMessage().isReply()), + DOCUMENT(upd -> MESSAGE.test(upd) && upd.getMessage().hasDocument()), + TEXT(upd -> MESSAGE.test(upd) && upd.getMessage().hasText()), + PHOTO(upd -> MESSAGE.test(upd) && upd.getMessage().hasPhoto()), + LOCATION(upd -> MESSAGE.test(upd) && upd.getMessage().hasLocation()), + CAPTION(upd -> MESSAGE.test(upd) && nonNull(upd.getMessage().getCaption())); private final Predicate predicate;