mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-03 19:00:21 +03:00
Expose grouped parameter in forward_messages (default True)
This commit is contained in:
parent
9965cda968
commit
cf3a4bc658
|
@ -610,7 +610,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
return self._get_response_message(request, result, entity)
|
return self._get_response_message(request, result, entity)
|
||||||
|
|
||||||
async def forward_messages(self, entity, messages, from_peer=None,
|
async def forward_messages(self, entity, messages, from_peer=None,
|
||||||
*, silent=None):
|
*, silent=None, grouped=True):
|
||||||
"""
|
"""
|
||||||
Forwards the given message(s) to the specified entity.
|
Forwards the given message(s) to the specified entity.
|
||||||
|
|
||||||
|
@ -632,6 +632,12 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
channel or not. Defaults to ``False``, which means it will
|
channel or not. Defaults to ``False``, which means it will
|
||||||
notify them. Set it to ``True`` to alter this behaviour.
|
notify them. Set it to ``True`` to alter this behaviour.
|
||||||
|
|
||||||
|
grouped (`bool`, optional):
|
||||||
|
Whether several image messages should be forwarded grouped
|
||||||
|
(as an album) or not. If you want to forward albums, this
|
||||||
|
must be ``True``. Sending as album is the default
|
||||||
|
(``grouped=True``).
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list of forwarded `telethon.tl.custom.message.Message`,
|
The list of forwarded `telethon.tl.custom.message.Message`,
|
||||||
or a single one if a list wasn't provided as input.
|
or a single one if a list wasn't provided as input.
|
||||||
|
@ -676,7 +682,8 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
from_peer=chat,
|
from_peer=chat,
|
||||||
id=group,
|
id=group,
|
||||||
to_peer=entity,
|
to_peer=entity,
|
||||||
silent=silent
|
silent=silent,
|
||||||
|
grouped=grouped
|
||||||
)
|
)
|
||||||
result = await self(req)
|
result = await self(req)
|
||||||
sent.extend(self._get_response_message(req, result, entity))
|
sent.extend(self._get_response_message(req, result, entity))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user