diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index b8cf8b0c..4f83cf0a 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -361,14 +361,12 @@ def start(format: bool = False): for i, arg in enumerate(sorted_args): arg_name, arg_type = arg - is_optional = FLAGS_RE.match(arg_type) - flag_number = is_optional.group(1) if is_optional else -1 arg_type = arg_type.split("?")[-1] docstring_args.append( "{}{}: {}".format( arg_name, - " (optional)".format(flag_number) if is_optional else "", + " (optional)", get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram") ) ) @@ -413,7 +411,8 @@ def start(format: bool = False): if flag.group(3) == "true" or flag.group(3).startswith("Vector"): write_flags.append(f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} else 0") else: - write_flags.append(f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0") + write_flags.append( + f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0") write_flags = "\n ".join([ f"{arg_name} = 0",