From 58c9f321b429bd4e2abcaaf5b8431073e84b53c6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 16 Apr 2018 11:53:38 +0200 Subject: [PATCH] Make send_venue return the new type --- pyrogram/client/client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 2eec0eb1..79a0a7d0 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -2231,12 +2231,12 @@ class Client: If the message is a reply, ID of the original message Returns: - On success, the sent Message is returned. + On success, the sent :obj:`Message ` is returned. Raises: :class:`Error ` """ - return self.send( + r = self.send( functions.messages.SendMedia( peer=self.resolve_peer(chat_id), media=types.InputMediaVenue( @@ -2257,6 +2257,13 @@ class Client: ) ) + for i in r.updates: + if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)): + users = {i.id: i for i in r.users} + chats = {i.id: i for i in r.chats} + + return message_parser.parse_message(self, i.message, users, chats) + def send_contact(self, chat_id: int or str, phone_number: str,