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