mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Add get_entities.. Should probably write what it returns... Question is just how to show it here.
parent
bab1dd6210
commit
5ae7d345f2
1 changed files with 7 additions and 0 deletions
|
@ -107,6 +107,13 @@ To download a file (you will need its `file_id`):
|
|||
>>> newFile.download('voice.ogg')
|
||||
```
|
||||
|
||||
To use MessageEntity extract the entities from a Message object using `get_entities`.
|
||||
Note: This method should always be used instead of the ``entities`` attribute, since it calculates the correct substring from the message text based on UTF-16 codepoints - that is, it extracts the correct string even on when working with weird characters such as Emojis.
|
||||
|
||||
```python
|
||||
>>> entities = message.get_entities()
|
||||
```
|
||||
|
||||
There are many more API methods, to read the full API documentation visit the [Telegram API documentation](https://core.telegram.org/bots/api) or the [library documentation of telegram.Bot](http://pythonhosted.org/python-telegram-bot/telegram.bot.html)
|
||||
|
||||
#### What to read next?
|
||||
|
|
Loading…
Reference in a new issue