From 62f9e49201e908e1b3e43fa6d5131e554e9ddbb6 Mon Sep 17 00:00:00 2001 From: Alexander Babai Date: Tue, 12 Apr 2016 23:53:44 +0300 Subject: [PATCH] Message move back some methods --- .../telegrambots/api/objects/Message.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/main/java/org/telegram/telegrambots/api/objects/Message.java b/src/main/java/org/telegram/telegrambots/api/objects/Message.java index 924d8f7e..4b18d640 100644 --- a/src/main/java/org/telegram/telegrambots/api/objects/Message.java +++ b/src/main/java/org/telegram/telegrambots/api/objects/Message.java @@ -278,6 +278,15 @@ public class Message implements IBotApiObject { return this; } + public List getEntities() { + return entities; + } + + public Message setEntities(List entities) { + this.entities = entities; + return this; + } + public Audio getAudio() { return audio; } @@ -341,6 +350,24 @@ public class Message implements IBotApiObject { return this; } + public Venue getVenue() { + return venue; + } + + public Message setVenue(Venue venue) { + this.venue = venue; + return this; + } + + public Message getPinnedMessage() { + return pinnedMessage; + } + + public Message setPinnedMessage(Message pinnedMessage) { + this.pinnedMessage = pinnedMessage; + return this; + } + public User getNewChatMember() { return newChatMember; } @@ -449,6 +476,42 @@ public class Message implements IBotApiObject { return this; } + public boolean isGroupMessage() { + return chat.isGroupChat(); + } + + public boolean isUserMessage() { + return chat.isUserChat(); + } + + public boolean isChannelMessage() { + return chat.isChannelChat(); + } + + public boolean isSuperGroupMessage() { + return chat.isSuperGroupChat(); + } + + public Long getChatId() { + return chat.getId(); + } + + public boolean hasText() { + return text != null && !text.isEmpty(); + } + + public boolean hasDocument() { + return this.document != null; + } + + public boolean isReply() { + return this.replyToMessage != null; + } + + public boolean hasLocation() { + return location != null; + } + @Override public void serialize(JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject();