mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-10 18:59:33 +00:00
Update code using get_input_entity
This commit is contained in:
@@ -58,7 +58,7 @@ class Draft:
|
||||
if not self.entity and await self.get_input_entity():
|
||||
try:
|
||||
self._entity =\
|
||||
await self._client.get_entity(self._input_entity)
|
||||
await self._client.get_profile(self._input_entity)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
@@ -143,7 +143,7 @@ class InlineResult:
|
||||
|
||||
"""
|
||||
if entity:
|
||||
entity = await self._client.get_input_entity(entity)
|
||||
entity = await self._client.get_input_peer(entity)
|
||||
elif self._entity:
|
||||
entity = self._entity
|
||||
else:
|
||||
|
@@ -72,7 +72,7 @@ class MessageButton:
|
||||
it will be "clicked" and the :tl:`BotCallbackAnswer` returned.
|
||||
|
||||
If it's an inline :tl:`KeyboardButtonUserProfile` button, the
|
||||
`client.get_entity` will be called and the resulting :tl:User will be
|
||||
`client.get_profile` will be called and the resulting :tl:User will be
|
||||
returned.
|
||||
|
||||
If it's an inline :tl:`KeyboardButtonSwitchInline` button, the
|
||||
@@ -112,7 +112,7 @@ class MessageButton:
|
||||
except BotResponseTimeoutError:
|
||||
return None
|
||||
elif isinstance(self.button, _tl.KeyboardButtonUserProfile):
|
||||
return await self._client.get_entity(self.button.user_id)
|
||||
return await self._client.get_profile(self.button.user_id)
|
||||
elif isinstance(self.button, _tl.KeyboardButtonSwitchInline):
|
||||
return await self._client(_tl.fn.messages.StartBot(
|
||||
bot=self._bot, peer=self._chat, start_param=self.button.query,
|
||||
|
Reference in New Issue
Block a user