mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Fix sending albums in conversations
This commit is contained in:
parent
6206a1a524
commit
ca2537941c
|
@ -72,12 +72,14 @@ class Conversation(ChatGetter):
|
||||||
for `telethon.client.messages.MessageMethods.send_message` with
|
for `telethon.client.messages.MessageMethods.send_message` with
|
||||||
``entity`` already set.
|
``entity`` already set.
|
||||||
"""
|
"""
|
||||||
message = await self._client.send_message(
|
sent = await self._client.send_message(
|
||||||
self._input_chat, *args, **kwargs)
|
self._input_chat, *args, **kwargs)
|
||||||
|
|
||||||
self._outgoing.add(message.id)
|
# Albums will be lists, so handle that
|
||||||
self._last_outgoing = message.id
|
ms = sent if isinstance(sent, list) else (sent,)
|
||||||
return message
|
self._outgoing.update(m.id for m in ms)
|
||||||
|
self._last_outgoing = ms[-1].id
|
||||||
|
return sent
|
||||||
|
|
||||||
async def send_file(self, *args, **kwargs):
|
async def send_file(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -85,12 +87,14 @@ class Conversation(ChatGetter):
|
||||||
for `telethon.client.uploads.UploadMethods.send_file` with
|
for `telethon.client.uploads.UploadMethods.send_file` with
|
||||||
``entity`` already set.
|
``entity`` already set.
|
||||||
"""
|
"""
|
||||||
message = await self._client.send_file(
|
sent = await self._client.send_file(
|
||||||
self._input_chat, *args, **kwargs)
|
self._input_chat, *args, **kwargs)
|
||||||
|
|
||||||
self._outgoing.add(message.id)
|
# Albums will be lists, so handle that
|
||||||
self._last_outgoing = message.id
|
ms = sent if isinstance(sent, list) else (sent,)
|
||||||
return message
|
self._outgoing.update(m.id for m in ms)
|
||||||
|
self._last_outgoing = ms[-1].id
|
||||||
|
return sent
|
||||||
|
|
||||||
def mark_read(self, message=None):
|
def mark_read(self, message=None):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user