mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
commit
2843a66e61
1 changed files with 8 additions and 7 deletions
|
|
@ -1567,29 +1567,30 @@ class Message(base.TelegramObject):
|
|||
async def send_copy(
|
||||
self: Message,
|
||||
chat_id: typing.Union[str, int],
|
||||
with_markup: bool = False,
|
||||
disable_notification: typing.Optional[bool] = None,
|
||||
reply_to_message_id: typing.Optional[int] = None,
|
||||
reply_markup: typing.Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, None] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
Send copy of current message
|
||||
|
||||
:param chat_id:
|
||||
:param with_markup:
|
||||
:param disable_notification:
|
||||
:param reply_to_message_id:
|
||||
:param reply_markup:
|
||||
:return:
|
||||
"""
|
||||
kwargs = {"chat_id": chat_id, "parse_mode": ParseMode.HTML}
|
||||
kwargs = {
|
||||
"chat_id": chat_id,
|
||||
"reply_markup": reply_markup or self.reply_markup,
|
||||
"parse_mode": ParseMode.HTML
|
||||
}
|
||||
text = self.html_text if (self.text or self.caption) else None
|
||||
|
||||
if disable_notification is not None:
|
||||
kwargs["disable_notification"] = disable_notification
|
||||
if reply_to_message_id is not None:
|
||||
kwargs["reply_to_message_id"] = reply_to_message_id
|
||||
if with_markup and self.reply_markup:
|
||||
kwargs["reply_markup"] = self.reply_markup
|
||||
|
||||
text = self.html_text if (self.text or self.caption) else None
|
||||
|
||||
if self.text:
|
||||
return await self.bot.send_message(text=text, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue