mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update message.py
Some fixes
This commit is contained in:
parent
b172faf89f
commit
1cd4712eb4
1 changed files with 3 additions and 7 deletions
|
|
@ -1582,19 +1582,15 @@ class Message(base.TelegramObject):
|
||||||
:param parse_mode:
|
:param parse_mode:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
kwargs = {"chat_id": chat_id, "reply_markup": reply_markup or self.reply_markup}
|
kwargs = {"chat_id": chat_id, "reply_markup": reply_markup or self.reply_markup, "parse_mode": parse_mode or ParseMode.HTML}
|
||||||
text = self.text or self.caption
|
text = self.text or self.caption
|
||||||
|
|
||||||
if disable_notification is not None:
|
if disable_notification is not None:
|
||||||
kwargs["disable_notification"] = disable_notification
|
kwargs["disable_notification"] = disable_notification
|
||||||
if reply_to_message_id is not None:
|
if reply_to_message_id is not None:
|
||||||
kwargs["reply_to_message_id"] = reply_to_message_id
|
kwargs["reply_to_message_id"] = reply_to_message_id
|
||||||
if parse_mode is not None:
|
if not kwargs.get("reply_markup"):
|
||||||
kwargs["parse_mode"] = parse_mode
|
kwargs.pop("reply_markup")
|
||||||
if parse_mode == 'html':
|
|
||||||
text = self.html_text if (self.text or self.caption) else None
|
|
||||||
if parse_mode == 'markdown':
|
|
||||||
text = self.md_text if (self.text or self.caption) else None
|
|
||||||
|
|
||||||
if self.text:
|
if self.text:
|
||||||
return await self.bot.send_message(text=text, **kwargs)
|
return await self.bot.send_message(text=text, **kwargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue