mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
'Refactored by Sourcery'
This commit is contained in:
parent
57c6766514
commit
d468016a90
1 changed files with 1 additions and 5 deletions
|
|
@ -50,11 +50,7 @@ class MessageEntity(base.TelegramObject):
|
|||
if sys.maxunicode == 0xFFFF:
|
||||
return text[self.offset : self.offset + self.length]
|
||||
|
||||
if not isinstance(text, bytes):
|
||||
entity_text = text.encode("utf-16-le")
|
||||
else:
|
||||
entity_text = text
|
||||
|
||||
entity_text = text.encode("utf-16-le") if not isinstance(text, bytes) else text
|
||||
entity_text = entity_text[self.offset * 2 : (self.offset + self.length) * 2]
|
||||
return entity_text.decode("utf-16-le")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue