Better autocast to InputPeerDialog and documentation

This commit is contained in:
Lonami Exo
2018-09-22 10:56:37 +02:00
parent 92c9bb12b7
commit cb6f980277
4 changed files with 21 additions and 4 deletions

View File

@@ -192,7 +192,8 @@ def _get_description(arg):
'<code>None</code> and can be omitted.')
otherwise = True
if arg.type in {'InputPeer', 'InputUser', 'InputChannel'}:
if arg.type in {'InputPeer', 'InputUser', 'InputChannel',
'InputNotifyPeer', 'InputDialogPeer'}:
desc.append(
'Anything entity-like will work if the library can find its '
'<code>Input</code> version (e.g., usernames, <code>Peer</code>, '

View File

@@ -20,9 +20,8 @@ AUTO_CASTS = {
'utils.get_input_channel(await client.get_input_entity({}))',
'InputUser':
'utils.get_input_user(await client.get_input_entity({}))',
'InputDialogPeer':
'utils.get_input_dialog(await client.get_input_entity({}))',
'InputDialogPeer': 'await client._get_input_dialog({})',
'InputNotifyPeer': 'await client._get_input_notify({})',
'InputMedia': 'utils.get_input_media({})',
'InputPhoto': 'utils.get_input_photo({})',