Internal methods should use .get_input_entity

This commit is contained in:
Lonami Exo 2017-10-01 16:54:11 +02:00
parent 1cdf879888
commit 8df4d7c4a5

View File

@ -315,7 +315,7 @@ class TelegramClient(TelegramBareClient):
If 'reply_to' is set to either a message or a message ID, If 'reply_to' is set to either a message or a message ID,
the sent message will be replying to such message. the sent message will be replying to such message.
""" """
entity = self.get_entity(entity) entity = self.get_input_entity(entity)
request = SendMessageRequest( request = SendMessageRequest(
peer=entity, peer=entity,
message=message, message=message,
@ -377,7 +377,7 @@ class TelegramClient(TelegramBareClient):
some performance loss. some performance loss.
""" """
result = self(GetHistoryRequest( result = self(GetHistoryRequest(
peer=self.get_entity(entity), peer=self.get_input_entity(entity),
limit=limit, limit=limit,
offset_date=offset_date, offset_date=offset_date,
offset_id=offset_id, offset_id=offset_id,
@ -423,7 +423,7 @@ class TelegramClient(TelegramBareClient):
max_id = messages.id max_id = messages.id
return self(ReadHistoryRequest( return self(ReadHistoryRequest(
peer=self.get_entity(entity), peer=self.get_input_entity(entity),
max_id=max_id max_id=max_id
)) ))
@ -526,7 +526,7 @@ class TelegramClient(TelegramBareClient):
# Once the media type is properly specified and the file uploaded, # Once the media type is properly specified and the file uploaded,
# send the media message to the desired entity. # send the media message to the desired entity.
self(SendMediaRequest( self(SendMediaRequest(
peer=self.get_entity(entity), peer=self.get_input_entity(entity),
media=media, media=media,
reply_to_msg_id=self._get_reply_to(reply_to) reply_to_msg_id=self._get_reply_to(reply_to)
)) ))