Update code using get_input_entity

This commit is contained in:
Lonami Exo
2022-03-02 12:54:30 +01:00
parent 5ff8eb8159
commit 6d293b440c
22 changed files with 77 additions and 70 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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,