/** * Get the text of a given message entity. * * @param MessageEntity $entity * @return string */ public function getEntityText($entity) { return $this->substr($this->getText(), $entity->getOffset(), $entity->getLength()); }