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:
Storm 2022-09-03 10:53:24 +05:00 committed by GitHub
parent 0b5f4d62c7
commit da2d707ed5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ from .base import UNSET, TelegramObject
if TYPE_CHECKING:
from ..methods import (
CopyMessage,
ForwardMessage,
DeleteMessage,
EditMessageCaption,
EditMessageReplyMarkup,
@ -1799,6 +1800,34 @@ class Message(TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
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(
self,