public function getType()
{
$types = ['text', 'audio', 'document', 'photo', 'sticker', 'video', 'voice', 'contact', 'location', 'venue', 'new_chat_member', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', 'group_chat_created', 'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message'];
foreach ($types as $type) {
if ($this->getProperty($type)) {
if ($type === 'text' && $this->getCommand()) {
return 'command';
}
return $type;
}
}
return 'message';
}