mirror of
https://github.com/paul-nameless/tg
synced 2024-11-22 03:43:19 +00:00
Fix sending msg: fallback to simple text when failed to parse entities (#147)
* Fix sending msg: fallback to simple text when failed to parse entities * Fix black formatting
This commit is contained in:
parent
16b6a5a4d9
commit
3d682441f2
1 changed files with 4 additions and 4 deletions
|
@ -59,12 +59,12 @@ class Tdlib(Telegram):
|
|||
return self._send_data(data)
|
||||
|
||||
def send_message(self, chat_id: int, msg: str) -> AsyncResult:
|
||||
text = {"@type": "formattedText", "text": msg}
|
||||
|
||||
result = self.parse_text_entities(msg)
|
||||
result.wait()
|
||||
if result.error:
|
||||
return result
|
||||
|
||||
text = result.update
|
||||
if not result.error:
|
||||
text = result.update
|
||||
|
||||
data = {
|
||||
"@type": "sendMessage",
|
||||
|
|
Loading…
Reference in a new issue