mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix Message.send_copy method for stories (#1287)
* Fix `Message.send_copy` method for stories Fixed an issue with the `Message.send_copy` method, which was not functioning properly with story-type messages. The `ForwardMessage` logic has been added to the method to enable copying of stories, in addition to other types. Tests and documentation have also been updated to reflect these changes. * Typo fix
This commit is contained in:
parent
6eb5ef2606
commit
e1be9dd668
4 changed files with 12 additions and 2 deletions
|
|
@ -2804,6 +2804,7 @@ class Message(TelegramObject):
|
|||
allow_sending_without_reply: Optional[bool] = None,
|
||||
message_thread_id: Optional[int] = None,
|
||||
) -> Union[
|
||||
ForwardMessage,
|
||||
SendAnimation,
|
||||
SendAudio,
|
||||
SendContact,
|
||||
|
|
@ -2839,6 +2840,7 @@ class Message(TelegramObject):
|
|||
:return:
|
||||
"""
|
||||
from ..methods import (
|
||||
ForwardMessage,
|
||||
SendAnimation,
|
||||
SendAudio,
|
||||
SendContact,
|
||||
|
|
@ -2957,6 +2959,12 @@ class Message(TelegramObject):
|
|||
return SendDice(
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.story:
|
||||
return ForwardMessage(
|
||||
from_chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
||||
raise TypeError("This type of message can't be copied.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue