Skip to content

Commit

Permalink
Update Telethon
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 13, 2023
1 parent 1fb8a7a commit 4f0770b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions mautrix_telegram/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3248,16 +3248,21 @@ def _split_dm_reaction_counts(self, counts: list[ReactionCount]) -> list[Message
for item in counts:
if item.count == 2:
reactions += [
MessagePeerReaction(reaction=item.reaction, peer_id=PeerUser(self.tgid)),
MessagePeerReaction(
reaction=item.reaction, peer_id=PeerUser(self.tg_receiver)
reaction=item.reaction, peer_id=PeerUser(self.tgid), date=None
),
MessagePeerReaction(
reaction=item.reaction,
peer_id=PeerUser(self.tg_receiver),
date=None,
),
]
elif item.count == 1:
reactions.append(
MessagePeerReaction(
reaction=item.reaction,
peer_id=PeerUser(self.tg_receiver if item.chosen_order else self.tgid),
date=None,
)
)
return reactions
Expand Down
7 changes: 6 additions & 1 deletion mautrix_telegram/tgclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from telethon.tl.types import (
InputMediaUploadedDocument,
InputMediaUploadedPhoto,
InputReplyToMessage,
TypeDocumentAttribute,
TypeInputMedia,
TypeInputPeer,
Expand Down Expand Up @@ -67,6 +68,10 @@ async def send_media(
entity = await self.get_input_entity(entity)
reply_to = utils.get_message_id(reply_to)
request = SendMediaRequest(
entity, media, message=caption or "", entities=entities or [], reply_to_msg_id=reply_to
entity,
media,
message=caption or "",
entities=entities or [],
reply_to=InputReplyToMessage(reply_to_msg_id=reply_to),
)
return self._get_response_message(request, await self(request), entity)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ commonmark>=0.8,<0.10
aiohttp>=3,<4
yarl>=1,<2
mautrix>=0.20.0,<0.21
tulir-telethon==1.29.0a2
tulir-telethon==1.30.0a1
asyncpg>=0.20,<0.28
mako>=1,<2
setuptools

0 comments on commit 4f0770b

Please sign in to comment.