mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 13:14:31 +03:00
Internal methods should use .get_input_entity
This commit is contained in:
parent
1cdf879888
commit
8df4d7c4a5
|
@ -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)
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user