mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
🐛 Fix crash when sending empty messages
This commit is contained in:
parent
2d97b66e99
commit
39f209783a
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ class TelegramMessage(co.Message):
|
||||||
async def reply(self, *,
|
async def reply(self, *,
|
||||||
text: str = None,
|
text: str = None,
|
||||||
files: t.List[t.BinaryIO] = None) -> t.Optional[TelegramMessage]:
|
files: t.List[t.BinaryIO] = None) -> t.Optional[TelegramMessage]:
|
||||||
sent = await self._msg.reply(message=tg_html_format(text), file=files, parse_mode="HTML")
|
sent = await self._msg.reply(message=tg_html_format(text) if text else None, file=files, parse_mode="HTML")
|
||||||
return TelegramMessage(msg=sent)
|
return TelegramMessage(msg=sent)
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class TelegramChannel(co.Channel):
|
||||||
files: t.List[t.BinaryIO] = None) -> t.Optional[TelegramMessage]:
|
files: t.List[t.BinaryIO] = None) -> t.Optional[TelegramMessage]:
|
||||||
sent = await self._client.send_message(
|
sent = await self._client.send_message(
|
||||||
self._channel,
|
self._channel,
|
||||||
message=tg_html_format(text),
|
message=tg_html_format(text) if text else None,
|
||||||
file=files,
|
file=files,
|
||||||
parse_mode="HTML"
|
parse_mode="HTML"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue