# danog\MadelineProto\EventHandler\Message\Rich\Text\AnchorLink: A link to an anchor of the rich message.

[Back to index](../../../../../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

A link to an anchor of the rich message.  



## Properties
* `$text`: `danog\MadelineProto\EventHandler\Message\Rich\RichText` The text
* `$name`: `string` Name of the anchor

## Method list:
* [`__construct(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text, string $name)`](#__construct)
* [`from(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text): \danog\MadelineProto\EventHandler\Message\Rich\RichText`](#from)
* [`getText(): string`](#getText)
* [`getEntities(): list<\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity>`](#getEntities)
* [`getHTML(bool $allowTelegramTags = false): string`](#getHTML)

## Methods:
### <a name="__construct"></a> `__construct(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text, string $name)`




Parameters:

* `$text`: `\danog\MadelineProto\EventHandler\Message\Rich\RichText|string`   
* `$name`: `string`   


#### See also: 
* [`\danog\MadelineProto\EventHandler\Message\Rich\RichText`: Styled text of a [rich message](https://core.telegram.org/bots/api#richtext): a tree of plain texts, styles, links and so on.](../../../../../../danog/MadelineProto/EventHandler/Message/Rich/RichText.html)




### <a name="from"></a> `from(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text): \danog\MadelineProto\EventHandler\Message\Rich\RichText`

Get a rich text from a rich text or a plain string.


Parameters:

* `$text`: `\danog\MadelineProto\EventHandler\Message\Rich\RichText|string`   



### <a name="getText"></a> `getText(): string`

Get the plain text version of the rich text.



### <a name="getEntities"></a> `getEntities(): list<\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity>`

Get the [entities](https://core.telegram.org/api/entities) for the styles of the plain text version of the rich text.


#### See also: 
* [`\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity`: Master class for message entities.](../../../../../../danog/MadelineProto/EventHandler/Message/Entities/MessageEntity.html)




### <a name="getHTML"></a> `getHTML(bool $allowTelegramTags = false): string`

Get an HTML version of the rich text.


Parameters:

* `$allowTelegramTags`: `bool` Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on...  



---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
