Skip to content

Commit 19b8f64

Browse files
committed
Fix bad behaviours for Python <3.6
Pyrogram was relying on dict keys being "ordered" (keys keeping insertion order).
1 parent 66f7045 commit 19b8f64

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pyrogram/client/methods/messages/send_message.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,18 @@ def send_message(self,
8888
)
8989

9090
if isinstance(r, types.UpdateShortSentMessage):
91+
peer = self.resolve_peer(chat_id)
92+
93+
peer_id = (
94+
peer.user_id
95+
if isinstance(peer, types.InputPeerUser)
96+
else -peer.chat_id
97+
)
98+
9199
return pyrogram.Message(
92100
message_id=r.id,
93101
chat=pyrogram.Chat(
94-
id=list(self.resolve_peer(chat_id).__dict__.values())[0],
102+
id=peer_id,
95103
type="private",
96104
client=self
97105
),

0 commit comments

Comments
 (0)