mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-24 07:51:44 +00:00
Merge branch 'new-api' into new-api-docs
This commit is contained in:
commit
4c3eb8a09f
@ -282,23 +282,24 @@ def start():
|
|||||||
flag_number = is_optional.group(1) if is_optional else -1
|
flag_number = is_optional.group(1) if is_optional else -1
|
||||||
arg_type = arg_type.split("?")[-1]
|
arg_type = arg_type.split("?")[-1]
|
||||||
|
|
||||||
if docs:
|
# if c.namespace == "pyrogram":
|
||||||
docstring_args.append(
|
# docstring_args.append(
|
||||||
"{} ({}{}):\n {}\n".format(
|
# "{} ({}{}):\n {}\n".format(
|
||||||
arg_name,
|
# arg_name,
|
||||||
get_docstring_arg_type(arg_type, is_pyrogram_type=True),
|
# get_docstring_arg_type(arg_type, is_pyrogram_type=True),
|
||||||
", optional" if "Optional" in docs[i] else "",
|
# ", optional" if "Optional" in docs[i] else "",
|
||||||
re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".")
|
# re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".")
|
||||||
)
|
# )
|
||||||
)
|
# )
|
||||||
else:
|
# else:
|
||||||
docstring_args.append(
|
|
||||||
"{}: {}{}".format(
|
docstring_args.append(
|
||||||
arg_name,
|
"{}{}: {}".format(
|
||||||
"``optional`` ".format(flag_number) if is_optional else "",
|
arg_name,
|
||||||
get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram")
|
" (optional)".format(flag_number) if is_optional else "",
|
||||||
)
|
get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram")
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if docstring_args:
|
if docstring_args:
|
||||||
docstring_args = "Args:\n " + "\n ".join(docstring_args)
|
docstring_args = "Args:\n " + "\n ".join(docstring_args)
|
||||||
|
Loading…
Reference in New Issue
Block a user