mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-28 16:59:46 +03:00
add new parameters
This commit is contained in:
parent
8036a6cc27
commit
cef9224678
|
@ -426,8 +426,10 @@ async def send_message(
|
|||
ttl: int = None,
|
||||
# - Send options
|
||||
reply_to: 'typing.Union[int, _tl.Message]' = None,
|
||||
send_as: 'hints.EntityLike' = None,
|
||||
clear_draft: bool = False,
|
||||
background: bool = None,
|
||||
noforwards: bool = None,
|
||||
schedule: 'hints.DateLike' = None,
|
||||
comment_to: 'typing.Union[int, _tl.Message]' = None,
|
||||
) -> '_tl.Message':
|
||||
|
@ -483,7 +485,7 @@ async def send_message(
|
|||
entity, message._file._media, reply_to_msg_id=reply_to, message=message._text,
|
||||
entities=message._fmt_entities, reply_markup=message._reply_markup, silent=message._silent,
|
||||
schedule_date=schedule, clear_draft=clear_draft,
|
||||
background=background
|
||||
background=background, noforwards=noforwards, send_as=send_as
|
||||
)
|
||||
else:
|
||||
request = _tl.fn.messages.SendMessage(
|
||||
|
@ -496,7 +498,9 @@ async def send_message(
|
|||
silent=silent,
|
||||
background=background,
|
||||
reply_markup=_custom.button.build_reply_markup(buttons),
|
||||
schedule_date=schedule
|
||||
schedule_date=schedule,
|
||||
noforwards=noforwards,
|
||||
send_as=send_as
|
||||
)
|
||||
|
||||
result = await self(request)
|
||||
|
@ -525,7 +529,9 @@ async def forward_messages(
|
|||
with_my_score: bool = None,
|
||||
silent: bool = None,
|
||||
as_album: bool = None,
|
||||
schedule: 'hints.DateLike' = None
|
||||
schedule: 'hints.DateLike' = None,
|
||||
noforwards: bool = None,
|
||||
send_as: 'hints.EntityLike' = None
|
||||
) -> 'typing.Sequence[_tl.Message]':
|
||||
if as_album is not None:
|
||||
warnings.warn('the as_album argument is deprecated and no longer has any effect')
|
||||
|
@ -565,7 +571,9 @@ async def forward_messages(
|
|||
silent=silent,
|
||||
background=background,
|
||||
with_my_score=with_my_score,
|
||||
schedule_date=schedule
|
||||
schedule_date=schedule,
|
||||
noforwards=noforwards,
|
||||
send_as=send_as
|
||||
)
|
||||
result = await self(req)
|
||||
sent.extend(self._get_response_message(req, result, entity))
|
||||
|
|
|
@ -113,6 +113,8 @@ async def send_file(
|
|||
reply_to: 'typing.Union[int, _tl.Message]' = None,
|
||||
clear_draft: bool = False,
|
||||
background: bool = None,
|
||||
noforwards: bool = None,
|
||||
send_as: 'hints.EntityLike' = None,
|
||||
schedule: 'hints.DateLike' = None,
|
||||
comment_to: 'typing.Union[int, _tl.Message]' = None,
|
||||
) -> '_tl.Message':
|
||||
|
@ -146,13 +148,16 @@ async def send_file(
|
|||
background=background,
|
||||
schedule=schedule,
|
||||
comment_to=comment_to,
|
||||
noforwards=noforwards,
|
||||
send_as=send_as
|
||||
)
|
||||
|
||||
async def _send_album(self: 'TelegramClient', entity, files, caption='',
|
||||
progress_callback=None, reply_to=None,
|
||||
parse_mode=(), silent=None, schedule=None,
|
||||
supports_streaming=None, clear_draft=None,
|
||||
force_document=False, background=None, ttl=None):
|
||||
force_document=False, background=None, ttl=None,
|
||||
send_as=None, noforwards=None):
|
||||
"""Specialized version of .send_file for albums"""
|
||||
# We don't care if the user wants to avoid cache, we will use it
|
||||
# anyway. Why? The cached version will be exactly the same thing
|
||||
|
@ -212,7 +217,7 @@ async def _send_album(self: 'TelegramClient', entity, files, caption='',
|
|||
request = _tl.fn.messages.SendMultiMedia(
|
||||
entity, reply_to_msg_id=reply_to, multi_media=media,
|
||||
silent=silent, schedule_date=schedule, clear_draft=clear_draft,
|
||||
background=background
|
||||
background=background, noforwards=noforwards, send_as=send_as
|
||||
)
|
||||
result = await self(request)
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ class InlineResult:
|
|||
|
||||
async def click(self, entity=None, reply_to=None, comment_to=None,
|
||||
silent=False, clear_draft=False, hide_via=False,
|
||||
background=None):
|
||||
background=None, send_as=None):
|
||||
"""
|
||||
Clicks this result and sends the associated `message`.
|
||||
|
||||
|
@ -137,6 +137,9 @@ class InlineResult:
|
|||
background (`bool`, optional):
|
||||
Whether the message should be send in background.
|
||||
|
||||
send_as (`entity`, optional):
|
||||
The channel entity on behalf of which, message should be send.
|
||||
|
||||
"""
|
||||
if entity:
|
||||
entity = await self._client.get_input_entity(entity)
|
||||
|
@ -158,7 +161,8 @@ class InlineResult:
|
|||
background=background,
|
||||
clear_draft=clear_draft,
|
||||
hide_via=hide_via,
|
||||
reply_to_msg_id=reply_id
|
||||
reply_to_msg_id=reply_id,
|
||||
send_as=send_as
|
||||
)
|
||||
return self._client._get_response_message(
|
||||
req, await self._client(req), entity)
|
||||
|
|
|
@ -209,7 +209,7 @@ class Message(ChatGetter, SenderGetter):
|
|||
grouped_id = _fwd('grouped_id', """
|
||||
If this message belongs to a group of messages
|
||||
(photo albums or video albums), all of them will
|
||||
have the same value here."""
|
||||
have the same value here.""")
|
||||
|
||||
restriction_reason = _fwd('restriction_reason', """
|
||||
An optional list of reasons why this message was restricted.
|
||||
|
|
Loading…
Reference in New Issue
Block a user