Skip to content

Commit

Permalink
Internal methods should use .get_input_entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Oct 1, 2017
1 parent 1cdf879 commit 8df4d7c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions telethon/telegram_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def send_message(self,
If 'reply_to' is set to either a message or a message ID,
the sent message will be replying to such message.
"""
entity = self.get_entity(entity)
entity = self.get_input_entity(entity)
request = SendMessageRequest(
peer=entity,
message=message,
Expand Down Expand Up @@ -377,7 +377,7 @@ def get_message_history(self,
some performance loss.
"""
result = self(GetHistoryRequest(
peer=self.get_entity(entity),
peer=self.get_input_entity(entity),
limit=limit,
offset_date=offset_date,
offset_id=offset_id,
Expand Down Expand Up @@ -423,7 +423,7 @@ def send_read_acknowledge(self, entity, messages=None, max_id=None):
max_id = messages.id

return self(ReadHistoryRequest(
peer=self.get_entity(entity),
peer=self.get_input_entity(entity),
max_id=max_id
))

Expand Down Expand Up @@ -526,7 +526,7 @@ def send_file(self, entity, file, caption='',
# Once the media type is properly specified and the file uploaded,
# send the media message to the desired entity.
self(SendMediaRequest(
peer=self.get_entity(entity),
peer=self.get_input_entity(entity),
media=media,
reply_to_msg_id=self._get_reply_to(reply_to)
))
Expand Down

0 comments on commit 8df4d7c

Please sign in to comment.