mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 06:14:51 +00:00
Make slicing text messages & captions work properly with entity offsets
This commit is contained in:
parent
de02848a69
commit
df386b2f91
1 changed files with 4 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ from ..object import Object
|
||||||
from ..update import Update
|
from ..update import Update
|
||||||
from ..user_and_chats.chat import Chat
|
from ..user_and_chats.chat import Chat
|
||||||
from ..user_and_chats.user import User
|
from ..user_and_chats.user import User
|
||||||
|
from ...style import utils
|
||||||
|
|
||||||
|
|
||||||
class Str(str):
|
class Str(str):
|
||||||
|
|
@ -58,6 +59,9 @@ class Str(str):
|
||||||
def html(self):
|
def html(self):
|
||||||
return self._client.html.unparse(self, self._entities)
|
return self._client.html.unparse(self, self._entities)
|
||||||
|
|
||||||
|
def __getitem__(self, item):
|
||||||
|
return utils.remove_surrogates(utils.add_surrogates(self)[item])
|
||||||
|
|
||||||
|
|
||||||
class Message(Object, Update):
|
class Message(Object, Update):
|
||||||
"""A message.
|
"""A message.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue