mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
added forward_to alias method to Message type
added alias for class ForwardMessage in types.Message with required parameter chat_id
This commit is contained in:
parent
0b5f4d62c7
commit
da2d707ed5
1 changed files with 29 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ from .base import UNSET, TelegramObject
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ..methods import (
|
from ..methods import (
|
||||||
CopyMessage,
|
CopyMessage,
|
||||||
|
ForwardMessage,
|
||||||
DeleteMessage,
|
DeleteMessage,
|
||||||
EditMessageCaption,
|
EditMessageCaption,
|
||||||
EditMessageReplyMarkup,
|
EditMessageReplyMarkup,
|
||||||
|
|
@ -1799,6 +1800,34 @@ class Message(TelegramObject):
|
||||||
allow_sending_without_reply=allow_sending_without_reply,
|
allow_sending_without_reply=allow_sending_without_reply,
|
||||||
reply_markup=reply_markup,
|
reply_markup=reply_markup,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def forward_to(
|
||||||
|
self,
|
||||||
|
chat_id: Union[int, str],
|
||||||
|
parse_mode: Optional[str] = UNSET,
|
||||||
|
disable_notification: Optional[bool] = None,
|
||||||
|
reply_to_message_id: Optional[int] = None,
|
||||||
|
protect_content: Optional[bool] = None
|
||||||
|
) -> ForwardMessage:
|
||||||
|
"""
|
||||||
|
Forward message
|
||||||
|
|
||||||
|
:param chat_id:
|
||||||
|
:param parse_mode:
|
||||||
|
:param disable_notification:
|
||||||
|
:param protect_content:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
from ..methods import ForwardMessage
|
||||||
|
|
||||||
|
return ForwardMessage(
|
||||||
|
chat_id=chat_id,
|
||||||
|
from_chat_id=self.chat.id,
|
||||||
|
message_id=self.message_id,
|
||||||
|
parse_mode=parse_mode,
|
||||||
|
disable_notification=disable_notification,
|
||||||
|
protect_content=protect_content
|
||||||
|
)
|
||||||
|
|
||||||
def edit_text(
|
def edit_text(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue