mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Make TelegramBareClient able to invoke requests
This commit is contained in:
@@ -14,10 +14,15 @@ AUTO_GEN_NOTICE = \
|
||||
|
||||
|
||||
AUTO_CASTS = {
|
||||
'InputPeer': 'utils.get_input_peer(client.get_input_entity({}))',
|
||||
'InputChannel': 'utils.get_input_channel(client.get_input_entity({}))',
|
||||
'InputUser': 'utils.get_input_user(client.get_input_entity({}))',
|
||||
'InputDialogPeer': 'utils.get_input_dialog(client.get_input_entity({}))',
|
||||
'InputPeer':
|
||||
'utils.get_input_peer(await client.get_input_entity({}))',
|
||||
'InputChannel':
|
||||
'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({}))',
|
||||
|
||||
'InputMedia': 'utils.get_input_media({})',
|
||||
'InputPhoto': 'utils.get_input_photo({})',
|
||||
'InputMessage': 'utils.get_input_message({})'
|
||||
@@ -234,7 +239,7 @@ def _write_class_init(tlobject, type_constructors, builder):
|
||||
|
||||
def _write_resolve(tlobject, builder):
|
||||
if any(arg.type in AUTO_CASTS for arg in tlobject.real_args):
|
||||
builder.writeln('def resolve(self, client, utils):')
|
||||
builder.writeln('async def resolve(self, client, utils):')
|
||||
for arg in tlobject.real_args:
|
||||
ac = AUTO_CASTS.get(arg.type, None)
|
||||
if not ac:
|
||||
|
Reference in New Issue
Block a user