add chat command detection to message (properties field)

This commit is contained in:
tschulz 2016-05-20 11:12:48 +02:00
parent f2da0a6558
commit 10d39077eb

View File

@ -361,6 +361,17 @@ public class Message implements IBotApiObject {
return text != null && !text.isEmpty();
}
public boolean isCommand() {
if (entities != null) {
for (MessageEntity entity : entities) {
if (entity != null && "bot_command".equals(entity.getType())) {
return text != null && !text.isEmpty();
}
}
}
return false;
}
public boolean hasDocument() {
return this.document != null;
}