add chat command detection to message (properties field)
This commit is contained in:
parent
f2da0a6558
commit
10d39077eb
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user