From dc73744fc4c976f9e4f6e5acf90b9280ef460b7b Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 25 Sep 2017 13:47:25 +0200 Subject: [PATCH] Add get_input_media calls on the generated code --- telethon_generator/tl_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telethon_generator/tl_generator.py b/telethon_generator/tl_generator.py index 53f95741..6455d3a4 100644 --- a/telethon_generator/tl_generator.py +++ b/telethon_generator/tl_generator.py @@ -168,6 +168,8 @@ class TLGenerator: util_imports.add('get_input_channel') elif a.type == 'InputUser': util_imports.add('get_input_user') + elif a.type == 'InputMedia': + util_imports.add('get_input_media') if util_imports: builder.writeln('from {}.utils import {}'.format( @@ -381,6 +383,8 @@ class TLGenerator: TLGenerator.write_get_input(builder, arg, 'get_input_channel') elif arg.type == 'InputUser' and tlobject.is_function: TLGenerator.write_get_input(builder, arg, 'get_input_user') + elif arg.type == 'InputMedia' and tlobject.is_function: + TLGenerator.write_get_input(builder, arg, 'get_input_media') else: builder.writeln('self.{0} = {0}'.format(arg.name))